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

Commits:

3 changed files:

Changes:

  • gajim/common/connection_handlers_events.py
    ... ... @@ -1506,8 +1506,7 @@ class GcMessageReceivedEvent(nec.NetworkIncomingEvent):
    1506 1506
     
    
    1507 1507
         def generate(self):
    
    1508 1508
             self.stanza = self.msg_obj.stanza
    
    1509
    -        if not hasattr(self, 'additional_data'):
    
    1510
    -            self.additional_data = self.msg_obj.additional_data
    
    1509
    +        self.additional_data = self.msg_obj.additional_data
    
    1511 1510
             self.id_ = self.msg_obj.stanza.getID()
    
    1512 1511
             self.fjid = self.msg_obj.fjid
    
    1513 1512
             self.msgtxt = self.msg_obj.msgtxt
    

  • gajim/conversation_textview.py
    ... ... @@ -1072,6 +1072,8 @@ class ConversationTextview(GObject.GObject):
    1072 1072
             """
    
    1073 1073
             Print 'chat' type messages
    
    1074 1074
             """
    
    1075
    +        if additional_data is None:
    
    1076
    +            additional_data = {}
    
    1075 1077
             buffer_ = self.tv.get_buffer()
    
    1076 1078
             buffer_.begin_user_action()
    
    1077 1079
             insert_mark = None
    

  • gajim/groupchat_control.py
    ... ... @@ -1097,23 +1097,29 @@ class GroupchatControl(ChatControlBase):
    1097 1097
                 self.is_anonymous = False
    
    1098 1098
             if not obj.nick:
    
    1099 1099
                 # message from server
    
    1100
    -            self.print_conversation(obj.msgtxt, tim=obj.timestamp,
    
    1101
    -                xhtml=obj.xhtml_msgtxt, displaymarking=obj.displaymarking)
    
    1100
    +            self.print_conversation(
    
    1101
    +                obj.msgtxt, tim=obj.timestamp,
    
    1102
    +                xhtml=obj.xhtml_msgtxt, displaymarking=obj.displaymarking,
    
    1103
    +                additional_data=obj.additional_data)
    
    1102 1104
             else:
    
    1103 1105
                 # message from someone
    
    1104 1106
                 if obj.has_timestamp:
    
    1105 1107
                     # don't print xhtml if it's an old message.
    
    1106 1108
                     # Like that xhtml messages are grayed too.
    
    1107
    -                self.print_old_conversation(obj.msgtxt, contact=obj.nick,
    
    1109
    +                self.print_old_conversation(
    
    1110
    +                    obj.msgtxt, contact=obj.nick,
    
    1108 1111
                         tim=obj.timestamp, xhtml=None, encrypted=obj.encrypted,
    
    1109
    -                    displaymarking=obj.displaymarking, msg_stanza_id=obj.id_)
    
    1112
    +                    displaymarking=obj.displaymarking, msg_stanza_id=obj.id_,
    
    1113
    +                    additional_data=obj.additional_data)
    
    1110 1114
                 else:
    
    1111 1115
                     if obj.nick == self.nick:
    
    1112 1116
                         self.last_sent_txt = obj.msgtxt
    
    1113
    -                self.print_conversation(obj.msgtxt, contact=obj.nick,
    
    1117
    +                self.print_conversation(
    
    1118
    +                    obj.msgtxt, contact=obj.nick,
    
    1114 1119
                         tim=obj.timestamp, xhtml=obj.xhtml_msgtxt,
    
    1115 1120
                         displaymarking=obj.displaymarking, encrypted=obj.encrypted,
    
    1116
    -                    correct_id=obj.correct_id, msg_stanza_id=obj.id_)
    
    1121
    +                    correct_id=obj.correct_id, msg_stanza_id=obj.id_,
    
    1122
    +                    additional_data=obj.additional_data)
    
    1117 1123
             obj.needs_highlight = self.needs_visual_notification(obj.msgtxt)
    
    1118 1124
     
    
    1119 1125
         def on_private_message(self, nick, sent, msg, tim, xhtml, session, msg_log_id=None,
    
    ... ... @@ -1168,7 +1174,10 @@ class GroupchatControl(ChatControlBase):
    1168 1174
             return None
    
    1169 1175
     
    
    1170 1176
         def print_old_conversation(self, text, contact='', tim=None, xhtml = None,
    
    1171
    -    displaymarking=None, msg_stanza_id=None, encrypted=None):
    
    1177
    +    displaymarking=None, msg_stanza_id=None, encrypted=None, additional_data=None):
    
    1178
    +        if additional_data is None:
    
    1179
    +            additional_data = {}
    
    1180
    +
    
    1172 1181
             if contact:
    
    1173 1182
                 if contact == self.nick: # it's us
    
    1174 1183
                     kind = 'outgoing'
    
    ... ... @@ -1185,11 +1194,11 @@ class GroupchatControl(ChatControlBase):
    1185 1194
                 small_attr, small_attr + ['restored_message'],
    
    1186 1195
                 small_attr + ['restored_message'], count_as_new=False, xhtml=xhtml,
    
    1187 1196
                 displaymarking=displaymarking, msg_stanza_id=msg_stanza_id,
    
    1188
    -            encrypted=encrypted)
    
    1197
    +            encrypted=encrypted, additional_data=additional_data)
    
    1189 1198
     
    
    1190 1199
         def print_conversation(self, text, contact='', tim=None, xhtml=None,
    
    1191 1200
         graphics=True, displaymarking=None, correct_id=None, msg_stanza_id=None,
    
    1192
    -    encrypted=None):
    
    1201
    +    encrypted=None, additional_data=None):
    
    1193 1202
             """
    
    1194 1203
             Print a line in the conversation
    
    1195 1204
     
    
    ... ... @@ -1197,6 +1206,8 @@ class GroupchatControl(ChatControlBase):
    1197 1206
             (contact = 'info' in such a case).
    
    1198 1207
             If contact is not set: it's a message from the server or help.
    
    1199 1208
             """
    
    1209
    +        if additional_data is None:
    
    1210
    +            additional_data = {}
    
    1200 1211
             other_tags_for_name = []
    
    1201 1212
             other_tags_for_text = []
    
    1202 1213
             if contact:
    
    ... ... @@ -1251,7 +1262,8 @@ class GroupchatControl(ChatControlBase):
    1251 1262
             ChatControlBase.print_conversation_line(self, text, kind, contact, tim,
    
    1252 1263
                 other_tags_for_name, [], other_tags_for_text, xhtml=xhtml,
    
    1253 1264
                 graphics=graphics, displaymarking=displaymarking,
    
    1254
    -            correct_id=correct_id, msg_stanza_id=msg_stanza_id, encrypted=encrypted)
    
    1265
    +            correct_id=correct_id, msg_stanza_id=msg_stanza_id, encrypted=encrypted,
    
    1266
    +            additional_data=additional_data)
    
    1255 1267
     
    
    1256 1268
         def get_nb_unread(self):
    
    1257 1269
             type_events = ['printed_marked_gc_msg']