Get rid of the muc_history_length option

It hasn’t worked for more than two years and no one complained.
Furthermore, poezio tries to be smart and request messages based on
previous activity, and not raw numbers.
This commit is contained in:
mathieui 2015-10-05 21:44:33 +02:00
parent 62491a4caa
commit 11d41625e2
5 changed files with 2 additions and 38 deletions

View file

@ -231,13 +231,6 @@ autorejoin_delay = 5
# will be "john_"
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 server default
# n: You will receive at most n messages
muc_history_length = 50
# set to 'true' if you want to save logs of all the messages
# in files.
use_log = false

View file

@ -942,23 +942,6 @@ Other
will default to :file:`$XDG_CACHE_HOME/poezio/images` which is
usually :file:`~/.cache/poezio/images`.
muc_history_length
**Default value:** ``50``
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
``n``: You will receive at most n messages
Note that if you set a huge number (like the default value), you
may not receive that much messages. The server has its own
maximum too.
remote_fifo_path
**Default value:** ``./``

View file

@ -308,7 +308,7 @@ def command_version(self, args):
fixes.get_version(self.xmpp, jid, callback=callback)
@command_args_parser.quoted(0, 2)
def command_join(self, args, histo_length=None):
def command_join(self, args):
"""
/join [room][/nick] [password]
"""
@ -366,12 +366,6 @@ def command_join(self, args, histo_length=None):
if room.startswith('@'):
room = room[1:]
if not histo_length:
histo_length = config.get('muc_history_length')
if histo_length == -1:
histo_length = None
if histo_length is not None:
histo_length = str(histo_length)
if len(args) == 2: # a password is provided
password = args[1]
if password is None: # try to use a saved password

View file

@ -56,17 +56,11 @@ def _join_initial_rooms(self, bookmarks):
self.open_new_room(bm.jid, nick, focus=False,
password=bm.password)
self.initial_joins.append(bm.jid)
histo_length = config.get('muc_history_length')
if histo_length == -1:
histo_length = None
if histo_length is not None:
histo_length = str(histo_length)
# do not join rooms that do not have autojoin
# but display them anyway
if bm.autojoin:
muc.join_groupchat(self, bm.jid, nick,
passwd=bm.password,
maxhistory=histo_length,
status=self.status.message,
show=self.status.show)

View file

@ -94,7 +94,7 @@ def change_nick(core, jid, nick, status=None, show=None):
core.events.trigger('changing_nick', presence)
presence.send()
def join_groupchat(core, jid, nick, passwd='', maxhistory=None, status=None, show=None, seconds=None):
def join_groupchat(core, jid, nick, passwd='', status=None, show=None, seconds=None):
xmpp = core.xmpp
stanza = xmpp.make_presence(pto='%s/%s' % (jid, nick), pstatus=status, pshow=show)
x = ET.Element('{http://jabber.org/protocol/muc}x')