From 536a504f692dd61a29395677fa7fef183e7c425d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 11 Nov 2017 23:25:58 +0100 Subject: [PATCH] Remove Support for mam:0 --- gajim/common/connection.py | 2 -- gajim/common/connection_handlers.py | 5 --- gajim/common/connection_handlers_events.py | 40 +--------------------- gajim/common/message_archiving.py | 8 ----- 4 files changed, 1 insertion(+), 54 deletions(-) diff --git a/gajim/common/connection.py b/gajim/common/connection.py index cd3c3e20e..c08735c51 100644 --- a/gajim/common/connection.py +++ b/gajim/common/connection.py @@ -1914,8 +1914,6 @@ class Connection(CommonConnection, ConnectionHandlers): self.archiving_namespace = nbxmpp.NS_MAM_2 elif nbxmpp.NS_MAM_1 in obj.features: self.archiving_namespace = nbxmpp.NS_MAM_1 - elif nbxmpp.NS_MAM in obj.features: - self.archiving_namespace = nbxmpp.NS_MAM if self.archiving_namespace: self.archiving_supported = True self.archiving_313_supported = True diff --git a/gajim/common/connection_handlers.py b/gajim/common/connection_handlers.py index 50161ce65..ab0c8acd1 100644 --- a/gajim/common/connection_handlers.py +++ b/gajim/common/connection_handlers.py @@ -1294,10 +1294,6 @@ ConnectionHandlersBase, ConnectionJingle, ConnectionIBBytestream): app.nec.register_incoming_event(ArchivingErrorReceivedEvent) app.nec.register_incoming_event( Archiving313PreferencesChangedReceivedEvent) - app.nec.register_incoming_event( - ArchivingFinishedLegacyReceivedEvent) - app.nec.register_incoming_event( - ArchivingFinishedReceivedEvent) app.nec.register_incoming_event(NotificationEvent) app.ged.register_event_handler('http-auth-received', ged.CORE, @@ -2238,7 +2234,6 @@ ConnectionHandlersBase, ConnectionJingle, ConnectionIBBytestream): con.RegisterHandler('iq', self._IqPingCB, 'get', nbxmpp.NS_PING) con.RegisterHandler('iq', self._SearchCB, 'result', nbxmpp.NS_SEARCH) con.RegisterHandler('iq', self._PrivacySetCB, 'set', nbxmpp.NS_PRIVACY) - con.RegisterHandler('iq', self._ArchiveCB, ns=nbxmpp.NS_MAM) con.RegisterHandler('iq', self._ArchiveCB, ns=nbxmpp.NS_MAM_1) con.RegisterHandler('iq', self._ArchiveCB, ns=nbxmpp.NS_MAM_2) con.RegisterHandler('iq', self._PubSubCB, 'result') diff --git a/gajim/common/connection_handlers_events.py b/gajim/common/connection_handlers_events.py index 7d8a93579..8ab709729 100644 --- a/gajim/common/connection_handlers_events.py +++ b/gajim/common/connection_handlers_events.py @@ -1341,8 +1341,7 @@ class MessageReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): self.forwarded = True result = self.stanza.getTag('result', protocol=True) - if result and result.getNamespace() in (nbxmpp.NS_MAM, - nbxmpp.NS_MAM_1, + if result and result.getNamespace() in (nbxmpp.NS_MAM_1, nbxmpp.NS_MAM_2): if result.getAttr('queryid') not in self.conn.mam_query_ids: @@ -1887,43 +1886,6 @@ class Archiving313PreferencesChangedReceivedEvent(nec.NetworkIncomingEvent): return True -class ArchivingFinishedReceivedEvent(nec.NetworkIncomingEvent): - name = 'archiving-finished' - base_network_events = ['archiving-received'] - - def generate(self): - self.conn = self.base_event.conn - self.stanza = self.base_event.stanza - self.type_ = self.base_event.type_ - self.fin = self.stanza.getTag('fin') - - if self.type_ != 'result' or not self.fin: - return - - self.query_id = self.fin.getAttr('queryid') - if not self.query_id: - return - - return True - -class ArchivingFinishedLegacyReceivedEvent(nec.NetworkIncomingEvent): - name = 'archiving-finished-legacy' - base_network_events = ['raw-message-received'] - - def generate(self): - self.conn = self.base_event.conn - self.stanza = self.base_event.stanza - self.fin = self.stanza.getTag('fin', namespace=nbxmpp.NS_MAM) - - if not self.fin: - return - - self.query_id = self.fin.getAttr('queryid') - if not self.query_id: - return - - return True - class AccountCreatedEvent(nec.NetworkIncomingEvent): name = 'account-created' base_network_events = [] diff --git a/gajim/common/message_archiving.py b/gajim/common/message_archiving.py index 558204ca6..9fd839035 100644 --- a/gajim/common/message_archiving.py +++ b/gajim/common/message_archiving.py @@ -38,10 +38,6 @@ class ConnectionArchive313: self.iq_answer = [] self.mam_query_ids = [] app.nec.register_incoming_event(ev.MamMessageReceivedEvent) - app.ged.register_event_handler('archiving-finished-legacy', ged.CORE, - self._nec_result_finished) - app.ged.register_event_handler('archiving-finished', ged.CORE, - self._nec_result_finished) app.nec.register_incoming_event(ev.MamGcMessageReceivedEvent) app.ged.register_event_handler('agent-info-error-received', ged.CORE, self._nec_agent_info_error) @@ -54,10 +50,6 @@ class ConnectionArchive313: self._nec_archiving_313_preferences_changed_received) def cleanup(self): - app.ged.remove_event_handler('archiving-finished-legacy', ged.CORE, - self._nec_result_finished) - app.ged.remove_event_handler('archiving-finished', ged.CORE, - self._nec_result_finished) app.ged.remove_event_handler('agent-info-error-received', ged.CORE, self._nec_agent_info_error) app.ged.remove_event_handler('agent-info-received', ged.CORE,