Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
f5c38850 by wurstsalat at 2021-10-21T00:18:24+02:00
ConversationView: Add message merge rule for encryption
- - - - -
661213cd by wurstsalat at 2021-10-21T00:21:13+02:00
ConversationView: Add border radius to conversation rows
- - - - -
037b2783 by wurstsalat at 2021-10-21T00:24:17+02:00
Remove 'Show next pending event' desktop action
- - - - -
3 changed files:
- data/org.gajim.Gajim.desktop.in
- gajim/data/style/gajim.css
- gajim/gtk/conversation/rows/message.py
Changes:
=====================================
data/org.gajim.Gajim.desktop.in
=====================================
@@ -20,9 +20,3 @@ Exec=gajim --start-chat
Name=Start a new chat
#Translators: Do NOT translate or transliterate this text (this is an icon
file name)!
Icon=org.gajim.Gajim
-
-[Desktop Action ShowNextPendingEvent]
-Exec=gajim --show-next-pending-event
-Name=Show next pending event
-#Translators: Do NOT translate or transliterate this text (this is an icon
file name)!
-Icon=org.gajim.Gajim
=====================================
gajim/data/style/gajim.css
=====================================
@@ -46,6 +46,7 @@ .conversation-row:hover button {
.conversation-row {
padding: 10px 3px 4px 6px;
+ border-radius: 4px;
}
.merged { padding-top: 1px;}
=====================================
gajim/gtk/conversation/rows/message.py
=====================================
@@ -66,6 +66,8 @@ def __init__(self,
self.name = name or ''
self.text = text
+ self.additional_data = additional_data
+
self._contact = contact
self._is_groupchat = False
if contact is not None and contact.is_groupchat:
@@ -187,11 +189,26 @@ def _get_avatar(self, kind, name):
def is_same_sender(self, message):
return message.name == self.name
+ def is_same_encryption(self, message):
+ message_details = self._get_encryption_details(message.additional_data)
+ own_details = self._get_encryption_details(self.additional_data)
+ if message_details is None and own_details is None:
+ return True
+ if message_details is not None and own_details is not None:
+ # *_details contains encryption method's name, fingerprint, trust
+ m_name, _, m_trust = message_details
+ o_name, _, o_trust = own_details
+ if m_name == o_name and m_trust == o_trust:
+ return True
+ return False
+
def is_mergeable(self, message):
if message.type != self.type:
return False
if not self.is_same_sender(message):
return False
+ if not self.is_same_encryption(message):
+ return False
return abs(message.timestamp - self.timestamp) < MERGE_TIMEFRAME
def on_copy_message(self, _widget):
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/eab5724364784210815d766d799ba7949d42240d...037b2783f9c35848023000c2b9206563c12368c5
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/eab5724364784210815d766d799ba7949d42240d...037b2783f9c35848023000c2b9206563c12368c5
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