Commit 98e66332 authored by nkour's avatar nkour

restore last lines for correct jid

parent 37638f7f
......@@ -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:
......
......@@ -120,7 +120,7 @@ def jid_is_from_pm(self, jid):
if row is not None:
print 'PM!!'
return True
else:
else: # FIXME: THIS NEVER HAPPENS?
print ' NO PM!!'
return False
......@@ -277,9 +277,9 @@ def get_last_conversation_lines(self, jid, restore_how_many_rows,
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()
......
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