Remove Support for mam:0
This commit is contained in:
parent
75b1d54b4c
commit
536a504f69
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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 = []
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue