Fix regression introduced in [9727]. Do not fail if the jid line contain 'Enter

JID or Contact name' or something at opening.
This commit is contained in:
Jean-Marie Traissard 2008-06-03 18:44:32 +00:00
parent d1762dd9a0
commit e5b2e38792

View file

@ -156,9 +156,12 @@ class HistoryWindow:
keys = self.completion_dict.keys() keys = self.completion_dict.keys()
# Move the actual jid at first so we load history faster # Move the actual jid at first so we load history faster
actual_jid = self.jid_entry.get_text().decode('utf-8') actual_jid = self.jid_entry.get_text().decode('utf-8')
if actual_jid in keys: if actual_jid.find('@') > 0:
keys.remove(actual_jid) # it's not 'Enter JID or Contact name' or something, but a real jid,
keys.insert(0, actual_jid) # we can really move it at first
if actual_jid in keys:
keys.remove(actual_jid)
keys.insert(0, actual_jid)
# Map jid to info tuple # Map jid to info tuple
# Warning : This for is time critical with big DB # Warning : This for is time critical with big DB
for key in keys: for key in keys: