logic fix
This commit is contained in:
parent
c3be096bc3
commit
ac4bb8b675
1 changed files with 15 additions and 12 deletions
|
@ -736,10 +736,10 @@ timestamp, contact):
|
||||||
# How many lines to restore and when to time them out
|
# How many lines to restore and when to time them out
|
||||||
restore = gajim.config.get('restore_lines')
|
restore = gajim.config.get('restore_lines')
|
||||||
time_out = gajim.config.get('restore_timeout')
|
time_out = gajim.config.get('restore_timeout')
|
||||||
pos = 0 # position, while reading from history
|
pos = 0 # position, while reading from history
|
||||||
size = 0 # how many lines we alreay retreived
|
size = 0 # how many lines we alreay retreived
|
||||||
lines = [] # we'll need to reverse the lines from history
|
lines = [] # we'll need to reverse the lines from history
|
||||||
count = gajim.logger.get_no_of_lines(jid)
|
count = gajim.logger.get_no_of_lines(jid)
|
||||||
|
|
||||||
|
|
||||||
if gajim.awaiting_messages[self.account].has_key(jid):
|
if gajim.awaiting_messages[self.account].has_key(jid):
|
||||||
|
@ -757,19 +757,22 @@ timestamp, contact):
|
||||||
pos = pos + 1
|
pos = pos + 1
|
||||||
|
|
||||||
# line is [] if log file for jid is not a file (does not exist or dir)
|
# line is [] if log file for jid is not a file (does not exist or dir)
|
||||||
if line != []:
|
if line == []:
|
||||||
if (now - float(line[0][0]))/60 >= time_out:
|
break
|
||||||
# stop looking for messages if we found something too old
|
|
||||||
break
|
|
||||||
|
|
||||||
if line[0][1] != 'sent' and line[0][1] != 'recv':
|
if (now - float(line[0][0]))/60 >= time_out:
|
||||||
# we don't want to display status lines, do we?
|
# stop looking for messages if we found something too old
|
||||||
continue
|
break
|
||||||
|
|
||||||
|
if line[0][1] != 'sent' and line[0][1] != 'recv':
|
||||||
|
# we don't want to display status lines, do we?
|
||||||
|
continue
|
||||||
|
|
||||||
lines.append(line[0])
|
lines.append(line[0])
|
||||||
size = size + 1
|
size = size + 1
|
||||||
|
|
||||||
lines.reverse()
|
if lines != []:
|
||||||
|
lines.reverse()
|
||||||
|
|
||||||
for msg in lines:
|
for msg in lines:
|
||||||
if msg[1] == 'sent':
|
if msg[1] == 'sent':
|
||||||
|
|
Loading…
Add table
Reference in a new issue