summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhur Garg <madhurgarg96@gmail.com>2019-08-12 01:12:59 +0530
committerMadhur Garg <madhurgarg96@gmail.com>2019-08-22 00:54:25 +0530
commita372e5f49fa78692589aad3b121b1059dcc66b77 (patch)
treedaaf9b58bd96fc4383f1e66c810c7d2378907bf6
parent4818210a6373261dcc122bb3c699b303ee5bd12f (diff)
downloadpoezio-a372e5f49fa78692589aad3b121b1059dcc66b77.tar.gz
poezio-a372e5f49fa78692589aad3b121b1059dcc66b77.tar.bz2
poezio-a372e5f49fa78692589aad3b121b1059dcc66b77.tar.xz
poezio-a372e5f49fa78692589aad3b121b1059dcc66b77.zip
Added a call to scroll for 10 messages on initially joining the room.
-rw-r--r--poezio/core/core.py3
-rw-r--r--poezio/multiuserchat.py11
2 files changed, 8 insertions, 6 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py
index 26543add..b195fb4e 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -29,6 +29,7 @@ from poezio import decorators
from poezio import events
from poezio import multiuserchat as muc
from poezio import tabs
+from poezio import mam
from poezio import theming
from poezio import timed_events
from poezio import windows
@@ -1997,6 +1998,7 @@ class Core:
if not tab:
self.open_new_room(
bm.jid, nick, focus=False, password=bm.password)
+ tab = self.tabs.by_name_and_class(bm.jid, tabs.MucTab)
self.initial_joins.append(bm.jid)
# do not join rooms that do not have autojoin
# but display them anyway
@@ -2008,6 +2010,7 @@ class Core:
passwd=bm.password,
status=self.status.message,
show=self.status.show)
+ mam.mam_scroll(tab)
def check_bookmark_storage(self, features):
private = 'jabber:iq:private' in features
diff --git a/poezio/multiuserchat.py b/poezio/multiuserchat.py
index ee596a0f..49e40791 100644
--- a/poezio/multiuserchat.py
+++ b/poezio/multiuserchat.py
@@ -13,7 +13,6 @@ slix plugin
from xml.etree import cElementTree as ET
from poezio.common import safeJID
-from poezio import mam
from slixmpp import JID
from slixmpp.exceptions import IqError, IqTimeout
import logging
@@ -124,11 +123,11 @@ def join_groupchat(core,
history = ET.Element('{http://jabber.org/protocol/muc}history')
history.attrib['seconds'] = str(0)
x.append(history)
- mam.mam_scroll(core.tabs.current_tab)
- elif seconds is not None:
- history = ET.Element('{http://jabber.org/protocol/muc}history')
- history.attrib['seconds'] = str(seconds)
- x.append(history)
+ else:
+ if seconds is not None:
+ history = ET.Element('{http://jabber.org/protocol/muc}history')
+ history.attrib['seconds'] = str(seconds)
+ x.append(history)
stanza.append(x)
core.events.trigger('joining_muc', stanza)
to = stanza["to"]