restore last lines for correct jid

This commit is contained in:
Nikos Kouremenos 2005-11-26 22:02:07 +00:00
parent 37638f7f81
commit 98e66332ee
2 changed files with 4 additions and 4 deletions

View File

@ -123,7 +123,7 @@ def get_jid(dirname, filename):
return jid
def decode_jid(string):
'''try to decode (to make it Unicode instance) given jid'''
'''try to decode (to make it Unicode instance) given string'''
# by the time we go to iso15 it better be the one else we show bad characters
encodings = (sys.getfilesystemencoding(), 'utf-8', 'iso-8859-15')
for encoding in encodings:

View File

@ -120,7 +120,7 @@ class Logger:
if row is not None:
print 'PM!!'
return True
else:
else: # FIXME: THIS NEVER HAPPENS?
print ' NO PM!!'
return False
@ -277,9 +277,9 @@ class Logger:
SELECT time, kind, message FROM logs
WHERE jid_id = %d AND kind IN (%d, %d, %d, %d)
ORDER BY time DESC LIMIT %d OFFSET %d
''' % (constants.KIND_SINGLE_MSG_RECV, constants.KIND_CHAT_MSG_RECV,
''' % (jid_id, constants.KIND_SINGLE_MSG_RECV, constants.KIND_CHAT_MSG_RECV,
constants.KIND_SINGLE_MSG_SENT, constants.KIND_CHAT_MSG_SENT,
jid_id, restore_how_many_rows, pending_how_many)
restore_how_many_rows, pending_how_many)
)
results = cur.fetchall()