Dont drop MAM Message on missing stanza-id

A missing stanza ID means, we will have to take some measures to make
sure we get no duplicates in the Database later on.

Also fix getting the origin-id. Third time is a charm.
This commit is contained in:
Philipp Hörist 2017-07-26 09:46:34 +02:00
parent 9d6e3f4323
commit fe1f2c0103
1 changed files with 2 additions and 3 deletions

View File

@ -1078,7 +1078,7 @@ class MamMessageReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
self.stanza_id = self.msg_.getTag('origin-id', self.stanza_id = self.msg_.getTag('origin-id',
namespace=nbxmpp.NS_SID) namespace=nbxmpp.NS_SID)
if self.stanza_id: if self.stanza_id:
self.stanza_id.getID() self.stanza_id = self.stanza_id.getID()
else: else:
self.stanza_id = self.msg_.getID() self.stanza_id = self.msg_.getID()
@ -1096,8 +1096,7 @@ class MamMessageReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
self.resource = frm.getResource() self.resource = frm.getResource()
if not self.stanza_id: if not self.stanza_id:
log.error('Could not retrieve stanza-id') log.debug('Could not retrieve stanza-id')
return False
# Use timestamp provided by archive, # Use timestamp provided by archive,
# Fallback: Use timestamp provided by user and issue a warning # Fallback: Use timestamp provided by user and issue a warning