changeset 2cd483328d9e in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=2cd483328d9e
description: ability to request room logs without time / number of stanza 
limit. Fixes #6877

diffstat:

 src/common/config.py     |   4 ++--
 src/common/connection.py |  26 ++++++++++++++++----------
 2 files changed, 18 insertions(+), 12 deletions(-)

diffs (50 lines):

diff -r 0b3285b1e32a -r 2cd483328d9e src/common/config.py
--- a/src/common/config.py      Mon Mar 21 11:49:42 2011 +0300
+++ b/src/common/config.py      Mon May 09 20:32:48 2011 +0200
@@ -166,8 +166,8 @@
             'change_roster_title': [ opt_bool, True, _('Add * and [n] in 
roster title?')],
             'restore_lines': [opt_int, 4, _('How many lines to remember from 
previous conversation when a chat tab/window is reopened.')],
             'restore_timeout': [opt_int, 60, _('How many minutes should last 
lines from previous conversation last.')],
-            'muc_restore_lines': [opt_int, 20, _('How many lines to request to 
server when entering a groupchat.')],
-            'muc_restore_timeout': [opt_int, 60, _('How many minutes back to 
request logs when a entering a groupchat.')],
+            'muc_restore_lines': [opt_int, 20, _('How many lines to request to 
server when entering a groupchat. -1 means no limit')],
+            'muc_restore_timeout': [opt_int, 60, _('How many minutes back to 
request logs when a entering a groupchat. -1 means no limit')],
             'muc_autorejoin_timeout': [opt_int, 1, _('How many seconds to wait 
before trying to autorejoin to a conference you are being disconnected from. 
Set to 0 to disable autorejoining.')],
             'muc_autorejoin_on_kick': [opt_bool, False, 'Should autorejoin be 
activated when we are being kicked from a conference?'],
             'send_on_ctrl_enter': [opt_bool, False, _('Send message on 
Ctrl+Enter and with Enter make new line (Mirabilis ICQ Client default 
behaviour).')],
diff -r 0b3285b1e32a -r 2cd483328d9e src/common/connection.py
--- a/src/common/connection.py  Mon Mar 21 11:49:42 2011 +0300
+++ b/src/common/connection.py  Mon May 09 20:32:48 2011 +0200
@@ -2059,16 +2059,22 @@
         self.add_lang(p)
         if not change_nick:
             t = p.setTag(common.xmpp.NS_MUC + ' x')
-            last_date = self.last_history_time[room_jid]
-            if last_date == 0:
-                last_date = time.time() - gajim.config.get(
-                        'muc_restore_timeout') * 60
-            else:
-                last_date = min(last_date, time.time() - gajim.config.get(
-                        'muc_restore_timeout') * 60)
-            last_date = time.strftime('%Y-%m-%dT%H:%M:%SZ', 
time.gmtime(last_date))
-            t.setTag('history', {'maxstanzas': gajim.config.get(
-                    'muc_restore_lines'), 'since': last_date})
+            tags = {}
+            timeout = gajim.config.get('muc_restore_timeout') * 60
+            if timeout >= 0:
+                last_date = self.last_history_time[room_jid]
+                if last_date == 0:
+                    last_date = time.time() - timeout
+                else:
+                    last_date = min(last_date, time.time() - timeout)
+                last_date = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(
+                    last_date))
+                tags['since'] = last_date
+            nb = gajim.config.get('muc_restore_lines')
+            if nb >= 0:
+                tags['maxstanzas'] = nb
+            if tags:
+                t.setTag('history', tags)
             if password:
                 t.setTagData('password', password)
         self.connection.send(p)
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to