Use the timestamp of the forwarded message in mam processing if possible. Fixes #8277

This commit is contained in:
tmolitor 2016-04-18 01:59:20 +02:00
parent fd7bebe016
commit eba838bdac
1 changed files with 6 additions and 0 deletions

View File

@ -1036,6 +1036,12 @@ class MamMessageReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
tim = helpers.datetime_tuple(tim)
self.tim = localtime(timegm(tim))
self.msg_ = self.stanza.getTag('message')
# use delay of archived message, if possible
delay = self.msg_.getTag('delay', namespace=nbxmpp.NS_DELAY2)
if delay:
tim = delay.getAttr('stamp')
tim = helpers.datetime_tuple(tim)
self.tim = localtime(timegm(tim))
to_ = self.msg_.getAttr('to')
if to_:
to_ = gajim.get_jid_without_resource(to_)