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
1 changed files with 13 additions and 7 deletions

View File

@ -200,13 +200,19 @@ class ConnectionArchive313:
def _nec_mam_decrypted_message_received(self, obj):
if obj.conn.name != self.name:
return
# if self.archiving_namespace != nbxmpp.NS_MAM_2:
# 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
namespace = self.archiving_namespace
if obj.groupchat:
namespace = muc_caps_cache.get_mam_namespace(obj.room_jid)
if namespace != nbxmpp.NS_MAM_2:
# 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,
obj.with_,
obj.timestamp,