Browse Source

Call marknoticedChat() for a chat that is going to be archived. It resets all fresh messages of that chat. This way the app badge counter doesn't take archived messages into account

cyberta 3 years ago
parent
commit
d4dff6d8b1
1 changed files with 1 additions and 0 deletions
  1. 1 0
      deltachat-ios/ViewModel/ChatListViewModel.swift

+ 1 - 0
deltachat-ios/ViewModel/ChatListViewModel.swift

@@ -184,6 +184,7 @@ class ChatListViewModel: NSObject {
         let chat = dcContext.getChat(chatId: chatId)
         let isArchivedBefore = chat.isArchived
         if !isArchivedBefore {
+            dcContext.marknoticedChat(chatId: chatId)
             NotificationManager.removeNotificationsForChat(dcContext: dcContext, chatId: chatId)
         }
         dcContext.archiveChat(chatId: chatId, archive: !isArchivedBefore)