# HG changeset patch # User Goffi # Date 1607592774 -3600 # Node ID c3f07c0cb2de998873aed3b7be3fb56427f228d8 # Parent d2298ed6de7f5fb047251ca5455734e1ca5139f2 plugin XEP-0431: Fulltext Search for MAM implementation diff -r d2298ed6de7f -r c3f07c0cb2de sat/plugins/plugin_xep_0313.py --- a/sat/plugins/plugin_xep_0313.py Thu Dec 10 10:28:05 2020 +0100 +++ b/sat/plugins/plugin_xep_0313.py Thu Dec 10 10:32:54 2020 +0100 @@ -43,7 +43,8 @@ C.PI_NAME: "Message Archive Management", C.PI_IMPORT_NAME: "XEP-0313", C.PI_TYPE: "XEP", - C.PI_PROTOCOLS: ["XEP-0313"], + # XEP-0431 only defines a namespace, so we register it here + C.PI_PROTOCOLS: ["XEP-0313", "XEP-0431"], C.PI_DEPENDENCIES: ["XEP-0059", "XEP-0359"], C.PI_MAIN: "XEP_0313", C.PI_HANDLER: "yes", @@ -55,6 +56,7 @@ KEY_LAST_STANZA_ID = "last_stanza_id" MESSAGE_RESULT = "/message/result[@xmlns='{mam_ns}' and @queryid='{query_id}']" MESSAGE_STANZA_ID = '/message/stanza-id[@xmlns="{ns_stanza_id}"]' +NS_FTS = "urn:xmpp:fulltext:0" class XEP_0313(object): @@ -62,6 +64,7 @@ log.info(_("Message Archive Management plugin initialization")) self.host = host self.host.registerNamespace("mam", mam.NS_MAM) + host.registerNamespace("fulltextmam", NS_FTS) self._rsm = host.plugins["XEP-0059"] self._sid = host.plugins["XEP-0359"] # Deferred used to store last stanza id in order of reception