Commit 056279ed authored by Philipp Hörist's avatar Philipp Hörist

Remove timestamp attribute from decrypted-message event

It's available via properties attribute
parent 05f9bd0b
......@@ -800,10 +800,12 @@ class ChatControl(ChatControlBase):
if obj.kind == KindConstant.CHAT_MSG_SENT:
kind = 'outgoing'
self.add_message(
obj.msgtxt, kind, tim=obj.timestamp,
correct_id=obj.correct_id,
message_id=obj.message_id, additional_data=obj.additional_data)
self.add_message(obj.msgtxt,
kind,
tim=obj.properties.mam.timestamp,
correct_id=obj.correct_id,
message_id=obj.message_id,
additional_data=obj.additional_data)
def _nec_decrypted_message_received(self, obj):
if not obj.msgtxt:
......@@ -818,12 +820,16 @@ class ChatControl(ChatControlBase):
if obj.forwarded and obj.sent:
typ = 'out'
self.add_message(obj.msgtxt, typ,
tim=obj.timestamp, subject=obj.properties.subject,
xhtml=obj.xhtml, displaymarking=obj.displaymarking,
msg_log_id=obj.msg_log_id, message_id=obj.message_id,
correct_id=obj.correct_id,
additional_data=obj.additional_data)
self.add_message(obj.msgtxt,
typ,
tim=obj.properties.timestamp,
subject=obj.properties.subject,
xhtml=obj.xhtml,
displaymarking=obj.displaymarking,
msg_log_id=obj.msg_log_id,
message_id=obj.message_id,
correct_id=obj.correct_id,
additional_data=obj.additional_data)
if obj.msg_log_id:
pw = self.parent_win
end = self.conv_textview.autoscroll
......
......@@ -421,7 +421,7 @@ class NotificationEvent(nec.NetworkIncomingEvent):
return
self.jid = msg_obj.jid
sound = msg_obj.gc_control.highlighting_for_message(
msg_obj.msgtxt, msg_obj.timestamp)[1]
msg_obj.msgtxt, msg_obj.properties.timestamp)[1]
if msg_obj.nickname != msg_obj.gc_control.nick:
self.do_sound = True
......
......@@ -232,7 +232,6 @@ class MAM(BaseModule):
{'conn': self._con,
'account': self._account,
'additional_data': additional_data,
'timestamp': properties.mam.timestamp,
'groupchat': groupchat,
'stanza_id': stanza_id,
'origin_id': message_id,
......
......@@ -189,7 +189,6 @@ class Message(BaseModule):
'correct_id': parse_correction(properties),
'msgtxt': msgtxt,
'session': session,
'timestamp': properties.timestamp,
'delayed': properties.user_timestamp is not None,
'gc_control': gc_control,
'xhtml': xhtml,
......@@ -248,7 +247,7 @@ class Message(BaseModule):
# so don't store it in logs
app.logger.insert_into_logs(self._account,
event.jid,
event.timestamp,
event.properties.timestamp,
KindConstant.GC_MSG,
message=event.msgtxt,
contact_name=event.nick,
......
......@@ -819,30 +819,33 @@ class GroupchatControl(ChatControlBase):
return
if obj.archive_jid != self.room_jid:
return
self.add_message(
obj.msgtxt, contact=obj.nick,
tim=obj.timestamp,
correct_id=obj.correct_id,
message_id=obj.message_id,
additional_data=obj.additional_data)
self.add_message(obj.msgtxt,
contact=obj.nick,
tim=obj.properties.mam.timestamp,
correct_id=obj.correct_id,
message_id=obj.message_id,
additional_data=obj.additional_data)
@event_filter(['account', 'room_jid'])
def _nec_gc_message_received(self, obj):
if not obj.nick:
# message from server
self.add_message(
obj.msgtxt, tim=obj.timestamp,
xhtml=obj.xhtml_msgtxt, displaymarking=obj.displaymarking,
additional_data=obj.additional_data)
self.add_message(obj.msgtxt,
tim=obj.properties.timestamp,
xhtml=obj.xhtml_msgtxt,
displaymarking=obj.displaymarking,
additional_data=obj.additional_data)
else:
if obj.nick == self.nick:
self.last_sent_txt = obj.msgtxt
self.add_message(
obj.msgtxt, contact=obj.nick,
tim=obj.timestamp, xhtml=obj.xhtml_msgtxt,
displaymarking=obj.displaymarking,
correct_id=obj.correct_id, message_id=obj.message_id,
additional_data=obj.additional_data)
self.add_message(obj.msgtxt,
contact=obj.nick,
tim=obj.properties.timestamp,
xhtml=obj.xhtml_msgtxt,
displaymarking=obj.displaymarking,
correct_id=obj.correct_id,
message_id=obj.message_id,
additional_data=obj.additional_data)
obj.needs_highlight = self.needs_visual_notification(obj.msgtxt)
def on_private_message(self, nick, sent, msg, tim, xhtml, session,
......@@ -1093,17 +1096,23 @@ class GroupchatControl(ChatControlBase):
if obj.sent:
frm = 'out'
obj.session.control.add_message(
obj.msgtxt, frm,
tim=obj.timestamp, xhtml=obj.xhtml,
obj.msgtxt,
frm,
tim=obj.properties.timestamp,
xhtml=obj.xhtml,
displaymarking=obj.displaymarking,
message_id=obj.message_id,
correct_id=obj.correct_id)
else:
# otherwise pass it off to the control to be queued
self.on_private_message(
nick, obj.sent, obj.msgtxt, obj.timestamp,
obj.xhtml, self.session, msg_log_id=obj.msg_log_id,
displaymarking=obj.displaymarking)
self.on_private_message(nick,
obj.sent,
obj.msgtxt,
obj.properties.timestamp,
obj.xhtml,
self.session,
msg_log_id=obj.msg_log_id,
displaymarking=obj.displaymarking)
def _nec_ping(self, obj):
if self.contact.jid != obj.contact.room_jid:
......
......@@ -369,7 +369,7 @@ class GajimRemote(Server):
# event has not been handled at GUI level
return
self.raise_signal('GCMessage', (obj.conn.name, [obj.fjid, obj.msgtxt,
obj.timestamp, obj.delayed, obj.xhtml_msgtxt,
obj.properties.timestamp, obj.delayed, obj.xhtml_msgtxt,
obj.displaymarking, obj.needs_highlight]))
def _nec_decrypted_message_received(self, obj):
......@@ -377,7 +377,7 @@ class GajimRemote(Server):
if obj.properties.is_muc_pm:
event_type = 'pm'
self.raise_signal('NewMessage', (
obj.conn.name, [obj.fjid, obj.msgtxt, obj.timestamp,
obj.conn.name, [obj.fjid, obj.msgtxt, obj.properties.timestamp,
event_type, obj.properties.subject,
obj.msg_log_id, obj.properties.nickname, obj.xhtml]))
......
......@@ -117,7 +117,10 @@ class ChatControlSession:
jid = obj.jid
obj.msg_log_id = app.logger.insert_into_logs(
self.conn.name, jid, obj.timestamp, log_type,
self.conn.name,
jid,
obj.properties.timestamp,
log_type,
message=msg_to_log,
subject=obj.properties.subject,
additional_data=obj.additional_data,
......@@ -228,7 +231,8 @@ class ChatControlSession:
event = event_t(
obj.msgtxt,
obj.properties.subject,
kind, obj.timestamp,
kind,
obj.properties.timestamp,
obj.resource,
obj.msg_log_id,
correct_id=obj.correct_id,
......
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