show the state's icon of the prioritest resource in chat window

This commit is contained in:
Yann Leboulanger 2004-07-18 21:38:14 +00:00
parent af5c1ca4c3
commit 12daa1954e

View file

@ -680,22 +680,27 @@ class roster_Window:
if not self.get_user_iter(user.jid, account): if not self.get_user_iter(user.jid, account):
self.add_user_to_roster(user.jid, account) self.add_user_to_roster(user.jid, account)
self.redraw_jid(user.jid, account) self.redraw_jid(user.jid, account)
for u in self.contacts[account][user.jid]: users = self.contacts[account][user.jid]
for u in users:
if u.resource == user.resource: if u.resource == user.resource:
u.show = show u.show = show
u.status = status u.status = status
break break
#Print status in chat window #Print status in chat window
if self.plugin.windows[account]['chats'].has_key(user.jid): if self.plugin.windows[account]['chats'].has_key(user.jid):
#TODO: should show pibuf of the prioritest resource prio = 0
if len(self.contacts[account][user.jid]) < 2: sho = users[0].show
img = self.pixbufs[show] for u in users:
if img.get_storage_type() == gtk.IMAGE_ANIMATION: if u.priority > prio:
self.plugin.windows[account]['chats'][user.jid].\ prio = u.priority
img.set_from_animation(img.get_animation()) sho = u.show
elif img.get_storage_type() == gtk.IMAGE_PIXBUF: img = self.pixbufs[sho]
self.plugin.windows[account]['chats'][user.jid].\ if img.get_storage_type() == gtk.IMAGE_ANIMATION:
img.set_from_pixbuf(img.get_pixbuf()) self.plugin.windows[account]['chats'][user.jid].\
img.set_from_animation(img.get_animation())
elif img.get_storage_type() == gtk.IMAGE_PIXBUF:
self.plugin.windows[account]['chats'][user.jid].\
img.set_from_pixbuf(img.get_pixbuf())
name = user.name name = user.name
if user.resource != '': if user.resource != '':
name += '/'+user.resource name += '/'+user.resource