From d3d39bad5d71096d1eb83c44edb20f143654568f Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 26 Dec 2018 17:21:39 +0100 Subject: [PATCH] plugin XEP-0045: fixed bad MAM detection on join --- sat/plugins/plugin_xep_0045.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sat/plugins/plugin_xep_0045.py b/sat/plugins/plugin_xep_0045.py index 52617035..413badf8 100755 --- a/sat/plugins/plugin_xep_0045.py +++ b/sat/plugins/plugin_xep_0045.py @@ -935,12 +935,15 @@ class SatMUCClient(muc.MUCClient): defer.returnValue(room) + @defer.inlineCallbacks def join(self, room_jid, nick, password=None): - if (not self._mam or not self.host.hasFeature(self.client, - mam.NS_MAM, room_jid)): - return self._joinLegacy(self.client, room_jid, nick, password) + has_mam = yield self.host.hasFeature(self.client, mam.NS_MAM, room_jid) + if not self._mam or not has_mam: + room = yield self._joinLegacy(self.client, room_jid, nick, password) + defer.returnValue(room) else: - return self._joinMAM(self.client, room_jid, nick, password) + room = yield self._joinMAM(self.client, room_jid, nick, password) + defer.returnValue(room) ## presence/roster ##