summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Krude <johannes@krude.de>2012-08-31 10:37:35 +0200
committerFlorent Le Coz <louiz@louiz.org>2012-09-02 14:06:04 +0200
commitaffdcb07b4b3fa4543d01dcc35ac358e76936084 (patch)
tree6b2119361ab0e1e9ca4703cf12ae2cfdea31d4ae
parentbf295541213e78c47987f4d774c102e7f1de1008 (diff)
downloadpoezio-affdcb07b4b3fa4543d01dcc35ac358e76936084.tar.gz
poezio-affdcb07b4b3fa4543d01dcc35ac358e76936084.tar.bz2
poezio-affdcb07b4b3fa4543d01dcc35ac358e76936084.tar.xz
poezio-affdcb07b4b3fa4543d01dcc35ac358e76936084.zip
added muc_history_length support
-rw-r--r--data/default_config.cfg2
-rw-r--r--src/core.py13
2 files changed, 13 insertions, 2 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg
index 834c629c..8c09d90f 100644
--- a/data/default_config.cfg
+++ b/data/default_config.cfg
@@ -172,7 +172,7 @@ alternative_nickname =
# Limit the number of messages you want to receive when the
# multiuserchat rooms send you recent history
# 0: You won't receive any
-# -1: You will receive the maximum
+# -1: You will receive the server default
# n: You will receive at most n messages
muc_history_length = 50
diff --git a/src/core.py b/src/core.py
index 5ed1cd17..d7f9f68e 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1476,6 +1476,12 @@ class Core(object):
if room.startswith('@'):
room = room[1:]
current_status = self.get_status()
+ if not histo_length:
+ histo_length= config.get('muc_history_length', 20)
+ if histo_length == -1:
+ histo_length= None
+ if histo_length:
+ histo_length= str(histo_length)
if tab and not tab.joined:
seconds = (int(time.time()) - tab.last_connection) if tab.last_connection != 0 else 0
muc.join_groupchat(self.xmpp, room, nick, password,
@@ -2539,7 +2545,12 @@ class Core(object):
self.open_new_room(bm.jid, bm.nick, False)
nick = bm.nick if bm.nick else self.own_nick
self.initial_joins.append(bm.jid)
- muc.join_groupchat(self.xmpp, bm.jid, nick)
+ histo_length= config.get('muc_history_length', 20)
+ if histo_length == -1:
+ histo_length= None
+ if histo_length:
+ histo_length= str(histo_length)
+ muc.join_groupchat(self.xmpp, bm.jid, nick, None, histo_length)
### Other handlers ###