summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2019-08-26 21:01:20 +0200
committermathieui <mathieui@mathieui.net>2019-08-26 21:01:20 +0200
commiteec8dcc20632bb63a6b87791428463ae9f43d5a1 (patch)
tree3d33b5e81c70dcb6213a06a9e63b3a85b6f9f23b
parent4d3830b4604ff8682ac06f01c9437f03d21b2239 (diff)
parentb8c7e16739c97b7c83df7918b92b199f0b3137e0 (diff)
downloadpoezio-eec8dcc20632bb63a6b87791428463ae9f43d5a1.tar.gz
poezio-eec8dcc20632bb63a6b87791428463ae9f43d5a1.tar.bz2
poezio-eec8dcc20632bb63a6b87791428463ae9f43d5a1.tar.xz
poezio-eec8dcc20632bb63a6b87791428463ae9f43d5a1.zip
Merge branch 'mam' into 'master'
Fixes message duplication on /reconnect. See merge request poezio/poezio!43
-rw-r--r--poezio/core/core.py6
-rw-r--r--poezio/multiuserchat.py5
2 files changed, 7 insertions, 4 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py
index b8855efe..74041429 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -2008,8 +2008,10 @@ class Core:
nick,
passwd=bm.password,
status=self.status.message,
- show=self.status.show)
- mam.mam_scroll(tab, action='query')
+ show=self.status.show,
+ tab=tab)
+ if tab._text_buffer.last_message is None:
+ mam.mam_scroll(tab, action='query')
def check_bookmark_storage(self, features):
private = 'jabber:iq:private' in features
diff --git a/poezio/multiuserchat.py b/poezio/multiuserchat.py
index 49e40791..47244e3d 100644
--- a/poezio/multiuserchat.py
+++ b/poezio/multiuserchat.py
@@ -109,7 +109,8 @@ def join_groupchat(core,
passwd='',
status=None,
show=None,
- seconds=None):
+ seconds=None,
+ tab=None):
xmpp = core.xmpp
stanza = xmpp.make_presence(
pto='%s/%s' % (jid, nick), pstatus=status, pshow=show)
@@ -119,7 +120,7 @@ def join_groupchat(core,
passelement.text = passwd
x.append(passelement)
def on_disco(iq):
- if 'urn:xmpp:mam:2' in iq['disco_info'].get_features():
+ if 'urn:xmpp:mam:2' in iq['disco_info'].get_features() or (tab and tab._text_buffer.last_message):
history = ET.Element('{http://jabber.org/protocol/muc}history')
history.attrib['seconds'] = str(0)
x.append(history)