Вход в каналы по ссылке, клоки отупел

This commit is contained in:
jganenok
2025-11-28 08:26:54 +07:00
parent 9745370613
commit 2e3e2c8dde
4 changed files with 24 additions and 2 deletions

View File

@@ -1027,7 +1027,7 @@ class _ChatsScreenState extends State<ChatsScreen>
color: Theme.of(context).colorScheme.onSecondaryContainer, color: Theme.of(context).colorScheme.onSecondaryContainer,
), ),
), ),
title: const Text('Присоединиться к группе'), title: const Text('Присоединиться по ссылке'),
subtitle: const Text('По ссылке-приглашению'), subtitle: const Text('По ссылке-приглашению'),
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);

View File

@@ -55,6 +55,28 @@ class _JoinGroupScreenState extends State<JoinGroupScreen> {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
// Обработка успешной подписки на канал (opcode 57)
if (message['cmd'] == 1 && message['opcode'] == 57) {
setState(() {
_isLoading = false;
});
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: const Text('Успешно подписались на канал!'),
backgroundColor: Colors.green,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
behavior: SnackBarBehavior.floating,
margin: const EdgeInsets.all(10),
),
);
Navigator.of(context).pop();
}
// Обработка ошибки подписки на канал (opcode 57)
if (message['cmd'] == 3 && message['opcode'] == 57) { if (message['cmd'] == 3 && message['opcode'] == 57) {
setState(() { setState(() {
_isLoading = false; _isLoading = false;

View File

@@ -108,7 +108,7 @@ class CustomThemePreset {
CustomThemePreset({ CustomThemePreset({
required this.id, required this.id,
required this.name, required this.name,
this.appTheme = AppTheme.system, this.appTheme = AppTheme.dark,
this.accentColor = Colors.blue, this.accentColor = Colors.blue,
this.useCustomChatWallpaper = false, this.useCustomChatWallpaper = false,
this.chatWallpaperType = ChatWallpaperType.solid, this.chatWallpaperType = ChatWallpaperType.solid,