Skip to content
Snippets Groups Projects
Commit 93fd8e08 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

replace Queues with list

parent 8312d6ee
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,6 @@ import pango
import gobject
import os
import time
import Queue
import common.sleepy
import tabbed_chat_window
......@@ -1003,8 +1002,8 @@ class Roster_window:
return
#We save it in a queue
if not self.plugin.queues[account].has_key(jid):
self.plugin.queues[account][jid] = Queue.Queue(50)
self.plugin.queues[account][jid].put((msg, tim, encrypted))
self.plugin.queues[account][jid] = []
self.plugin.queues[account][jid].append((msg, tim, encrypted))
self.nb_unread += 1
if (not autopopup or ( not autopopupaway and \
gajim.connections[account].connected > 2)) and not \
......
......@@ -324,10 +324,9 @@ class Tabbed_chat_window(chat.Chat):
def read_queue(self, jid):
"""read queue and print messages containted in it"""
q = self.plugin.queues[self.account][jid]
l = self.plugin.queues[self.account][jid]
user = self.users[jid]
while not q.empty():
event = q.get()
for event in l:
self.print_conversation(event[0], jid, tim = event[1],
encrypted = event[2])
self.plugin.roster.nb_unread -= 1
......@@ -390,7 +389,7 @@ class Tabbed_chat_window(chat.Chat):
if self.plugin.queues[self.account].has_key(jid):
pos = self.plugin.queues[self.account][jid].qsize()
pos = len(self.plugin.queues[self.account][jid])
else:
pos = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment