we need to have messages in a queue before we do new_chat() in order not to have message printed twice

This commit is contained in:
Yann Leboulanger 2005-07-01 22:13:45 +00:00
parent 2b42ff7572
commit 25f03759cd
1 changed files with 14 additions and 8 deletions

View File

@ -342,14 +342,20 @@ class Interface:
if self.windows[account]['gc'].has_key(jid): # it's a Private Message
nick = array[0].split('/', 1)[1]
fjid = jid + '/' + nick
if not self.windows[account]['chats'].has_key(fjid):
if self.windows[account]['chats'].has_key(fjid):
chat_win = self.windows[account]['chats'][fjid]
chat_win.print_conversation(array[1], fjid, tim = array[2])
return
qs = self.queues[account]
if not qs.has_key(fjid):
qs[fjid] = []
qs[fjid].append((array[1], array[2], array[3]))
self.roster.nb_unread += 1
gc = self.windows[account]['gc'][jid]
show = gc.contacts[jid][nick].show
u = Contact(jid = fjid, name = nick, groups = ['none'], show = show,
ask = 'none')
self.roster.new_chat(u, account)
chat_win = self.windows[account]['chats'][fjid]
chat_win.print_conversation(array[1], fjid, tim = array[2])
return