Philipp Hörist pushed to branch master at gajim / gajim
Commits:
c45d0f5b by Philipp Hörist at 2017-11-19T23:45:03+01:00
Query MUC archives with the correct namespace
- - - - -
2 changed files:
- gajim/common/caps_cache.py
- gajim/common/message_archiving.py
Changes:
=====================================
gajim/common/caps_cache.py
=====================================
--- a/gajim/common/caps_cache.py
+++ b/gajim/common/caps_cache.py
@@ -491,3 +491,12 @@ class MucCapsCache:
return True
except (KeyError, AttributeError):
return False
+
+ def get_mam_namespace(self, jid):
+ try:
+ if nbxmpp.NS_MAM_2 in self.cache[jid].features:
+ return nbxmpp.NS_MAM_2
+ elif nbxmpp.NS_MAM_1 in self.cache[jid].features:
+ return nbxmpp.NS_MAM_1
+ except (KeyError, AttributeError):
+ return
=====================================
gajim/common/message_archiving.py
=====================================
--- a/gajim/common/message_archiving.py
+++ b/gajim/common/message_archiving.py
@@ -27,6 +27,7 @@ from gajim.common import app
from gajim.common import ged
from gajim.common.logger import KindConstant, JIDConstant
from gajim.common.const import ArchiveState
+from gajim.common.caps_cache import muc_caps_cache
import gajim.common.connection_handlers_events as ev
log = logging.getLogger('gajim.c.message_archiving')
@@ -296,7 +297,12 @@ class ConnectionArchive313:
def get_archive_query(self, query_id, jid=None, start=None, end=None,
with_=None,
after=None, max_=30):
- namespace = self.archiving_namespace
+ # Muc archive query?
+ namespace = muc_caps_cache.get_mam_namespace(jid)
+ if namespace is None:
+ # Query to our own archive
+ namespace = self.archiving_namespace
+
iq = nbxmpp.Iq('set', to=jid)
query = iq.addChild('query', namespace=namespace)
form = query.addChild(node=nbxmpp.DataForm(typ='submit'))
View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/c45d0f5b279a42488bd90b7524f6d664498ce7c7
---
View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/c45d0f5b279a42488bd90b7524f6d664498ce7c7
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits