more beautifull code

This commit is contained in:
Yann Leboulanger 2005-07-01 22:20:01 +00:00
parent 25f03759cd
commit 48d36a16e5
1 changed files with 5 additions and 4 deletions

View File

@ -1227,17 +1227,18 @@ _('If "%s" accepts this request you will know his status.') %jid).get_response()
autopopup = gajim.config.get('autopopup') autopopup = gajim.config.get('autopopup')
autopopupaway = gajim.config.get('autopopupaway') autopopupaway = gajim.config.get('autopopupaway')
# Do we have a queue ? # Do we have a queue ?
qs = self.plugin.queues[account]
no_queue = True no_queue = True
if self.plugin.queues[account].has_key(jid): if qs.has_key(jid):
no_queue = False no_queue = False
if self.plugin.windows[account]['chats'].has_key(jid): if self.plugin.windows[account]['chats'].has_key(jid):
self.plugin.windows[account]['chats'][jid].print_conversation(msg, self.plugin.windows[account]['chats'][jid].print_conversation(msg,
jid, tim = tim, encrypted = encrypted) jid, tim = tim, encrypted = encrypted)
return return
#We save it in a queue #We save it in a queue
if not self.plugin.queues[account].has_key(jid): if no_queue:
self.plugin.queues[account][jid] = [] qs[jid] = []
self.plugin.queues[account][jid].append((msg, tim, encrypted)) qs[jid].append((msg, tim, encrypted))
self.nb_unread += 1 self.nb_unread += 1
if (not autopopup or ( not autopopupaway and \ if (not autopopup or ( not autopopupaway and \
gajim.connections[account].connected > 2)) and not \ gajim.connections[account].connected > 2)) and not \