Commit 5db3dc55 authored by Philipp Hörist's avatar Philipp Hörist

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.
parent 0cba9f53
......@@ -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,
if isinstance(event.msg_log_id, int):
......@@ -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
......@@ -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,
session=self, form_node=obj.form_node,
sent_forwarded=obj.forwarded and obj.sent,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment