Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
e298a729 by wurstsalat at 2021-12-20T19:19:39+01:00
ChatList: Process incoming nickname correctly for MUCs

- - - - -


1 changed file:

- gajim/gtk/chat_list.py


Changes:

=====================================
gajim/gtk/chat_list.py
=====================================
@@ -390,7 +390,7 @@ def _on_message_received(self, event):
             nickname=nick,
             additional_data=event.additional_data)
 
-        self._add_unread(row, event.properties, event.msgtxt)
+        self._add_unread(row, event)
         self.invalidate_sort()
 
     def _on_message_updated(self, event):
@@ -473,16 +473,23 @@ def _on_file_request_received(self, event):
             _('File'), icon_name='text-x-generic-symbolic')
 
     @staticmethod
-    def _add_unread(row, properties, text):
-        if properties.is_carbon_message and properties.carbon.is_sent:
+    def _add_unread(row, event):
+        if event.properties.is_carbon_message:
+            if event.properties.carbon.is_sent:
+                return
+
+        if event.properties.is_from_us():
+            # Last message was from us (1:1), reset counter
+            row.reset_unread()
             return
 
-        if properties.is_from_us():
-            # Last message was from us, reset counter
+        our_nick = get_group_chat_nick(event.account, event.jid)
+        if event.properties.muc_nickname == our_nick:
+            # Last message was from us (MUC), reset counter
             row.reset_unread()
             return
 
-        row.add_unread(text)
+        row.add_unread(event.msgtxt)
 
     def _on_account_changed(self, *args):
         for row in self.get_children():



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/e298a729ed9e34de361564c732ce69d18af6fa63

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/e298a729ed9e34de361564c732ce69d18af6fa63
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to