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


Commits:
5db3dc55 by Philipp Hörist at 2019-10-01T18:08:37Z
Fix LMC in when ChatControl is not open

When the ChatControl is not open we create a ChatEvent. The current
message id was not passed to ChatEvent. So on correction the
ConversationTextview could not find the messages it was supposed to correct

This adds a message_id attr to ChatEvent.

- - - - -


3 changed files:

- gajim/chat_control.py
- gajim/common/events.py
- gajim/session.py


Changes:

=====================================
gajim/chat_control.py
=====================================
@@ -1284,7 +1284,8 @@ class ChatControl(ChatControlBase):
             self.add_message(event.message, kind, tim=event.time,
                 encrypted=event.encrypted, subject=event.subject,
                 xhtml=event.xhtml, displaymarking=event.displaymarking,
-                correct_id=event.correct_id, 
additional_data=event.additional_data)
+                correct_id=event.correct_id, message_id=event.message_id,
+                additional_data=event.additional_data)
             if isinstance(event.msg_log_id, int):
                 message_ids.append(event.msg_log_id)
 


=====================================
gajim/common/events.py
=====================================
@@ -62,7 +62,7 @@ class Event:
 class ChatEvent(Event):
     type_ = 'chat'
     def __init__(self, message, subject, kind, time_, encrypted, resource,
-    msg_log_id, correct_id=None, xhtml=None, session=None, form_node=None,
+    msg_log_id, correct_id=None, message_id=None, xhtml=None, session=None, 
form_node=None,
     displaymarking=None, sent_forwarded=False, show_in_roster=False,
     show_in_systray=True, additional_data=None):
         Event.__init__(self, time_, show_in_roster=show_in_roster,
@@ -74,6 +74,7 @@ class ChatEvent(Event):
         self.encrypted = encrypted
         self.resource = resource
         self.msg_log_id = msg_log_id
+        self.message_id = message_id
         self.correct_id = correct_id
         self.xhtml = xhtml
         self.session = session


=====================================
gajim/session.py
=====================================
@@ -253,7 +253,9 @@ class ChatControlSession:
         if do_event:
             event = event_t(obj.msgtxt, obj.subject, obj.mtype, obj.timestamp,
                 obj.encrypted, obj.resource, obj.msg_log_id,
-                correct_id=(obj.id_, obj.correct_id), xhtml=obj.xhtml,
+                correct_id=obj.correct_id,
+                message_id=obj.message_id,
+                xhtml=obj.xhtml,
                 session=self, form_node=obj.form_node,
                 displaymarking=obj.displaymarking,
                 sent_forwarded=obj.forwarded and obj.sent,



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/5db3dc55305b201722f9da74db732af98dbd047d

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/5db3dc55305b201722f9da74db732af98dbd047d
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