Commit 27c1cee0 authored by louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13's avatar louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
Browse files

Allow the user to limit the number of history messages. fixed #1658

parent 9a822ed7
......@@ -150,12 +150,19 @@ class MultiUserChat(object):
"""Join a new room"""
pres = Presence(to='%s/%s' % (room, nick))
if not password:
pres.addChild(name='x', namespace=NS_MUC)
item = pres.addChild(name='x', namespace=NS_MUC)
passwd = item.addChild(name='password')
x_tag = pres.addChild(name='x', namespace=NS_MUC)
if password:
passwd = x_tag.addChild(name='password')
muc_history_length = config.get('muc_history_length', -1)
if muc_history_length >= 0:
history_tag = x_tag.addChild(name='history')
if muc_history_length == 0:
history_tag.setAttr('maxchars', 0)
history_tag.setAttr('maxstanzas', muc_history_length)
from common import debug
debug('%s\n'% pres)
def quit_room(self, room, nick, msg=None):
......@@ -23,6 +23,7 @@ Starting point of poezio. Launches both the Connection and Gui
import threading
import sys
import traceback
def installThreadExcepthook():
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment