Philipp Hörist pushed to branch master at gajim / gajim


Commits:
b52e8dfb by Philipp Hörist at 2024-06-16T15:31:05+02:00
fix: SecurityLabels: Fix merging messages with same security label

- - - - -


1 changed file:

- gajim/gtk/conversation/rows/message.py


Changes:

=====================================
gajim/gtk/conversation/rows/message.py
=====================================
@@ -378,14 +378,16 @@ def is_same_encryption(self, message: MessageRow) -> bool:
         return False
 
     def is_same_securitylabels(self, message: MessageRow) -> bool:
-        if message.securitylabel == self.securitylabel:
+        sec1 = message.securitylabel
+        sec2 = self.securitylabel
+
+        if sec1 is None and sec2 is None:
             return True
-        if (message.securitylabel is not None and
-                self.securitylabel is not None):
-            if (message.securitylabel.displaymarking ==
-                    self.securitylabel.displaymarking):
-                return True
-        return False
+
+        if sec1 is None or sec2 is None:
+            return False
+
+        return sec1.label_hash == sec2.label_hash
 
     def is_same_state(self, message: MessageRow) -> bool:
         return message.state == self.state



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

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


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to