fix: щавель виноград, ебырь омайгад

This commit is contained in:
Jganenokk
2026-06-30 16:00:16 +07:00
parent d40cb31b80
commit 4b4aeec92a
10 changed files with 357 additions and 30 deletions
+30
View File
@@ -328,6 +328,36 @@ class ChatsModule {
_bump();
}
static Future<int?> markUnread(
Api api,
int accountId,
int chatId,
int mark,
) async {
int? unread;
try {
final resp = await api.sendRequest(Opcode.chatMark, {
'type': 'SET_AS_UNREAD',
'chatId': chatId,
'mark': mark,
});
final payload = resp.payload;
if (payload is Map) unread = payload['unread'] as int?;
} catch (_) {
return null;
}
if (unread == null) return null;
final rows = await AppDatabase.loadChat(accountId, chatId);
if (rows.isNotEmpty) {
final row = Map<String, dynamic>.from(rows.first);
row['unread_count'] = unread;
await AppDatabase.saveChats([row]);
_bump();
}
return unread;
}
static Future<void> applyOutgoing(
int accountId,
int chatId, {