Only use fallback duplicate search on MAM < 2

This commit is contained in:
Philipp Hörist 2018-02-25 22:02:39 +01:00
parent c74c888506
commit 77be67f6a8

View file

@ -200,13 +200,19 @@ class ConnectionArchive313:
def _nec_mam_decrypted_message_received(self, obj): def _nec_mam_decrypted_message_received(self, obj):
if obj.conn.name != self.name: if obj.conn.name != self.name:
return return
# if self.archiving_namespace != nbxmpp.NS_MAM_2:
# Fallback duplicate search without stanza-id namespace = self.archiving_namespace
duplicate = app.logger.search_for_duplicate( if obj.groupchat:
self.name, obj.with_, obj.timestamp, obj.msgtxt) namespace = muc_caps_cache.get_mam_namespace(obj.room_jid)
if duplicate:
# dont propagate the event further if namespace != nbxmpp.NS_MAM_2:
return True # Fallback duplicate search without stanza-id
duplicate = app.logger.search_for_duplicate(
self.name, obj.with_, obj.timestamp, obj.msgtxt)
if duplicate:
# dont propagate the event further
return True
app.logger.insert_into_logs(self.name, app.logger.insert_into_logs(self.name,
obj.with_, obj.with_,
obj.timestamp, obj.timestamp,