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,16 +680,21 @@ 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 u.priority > prio:
prio = u.priority
sho = u.show
img = self.pixbufs[sho]
if img.get_storage_type() == gtk.IMAGE_ANIMATION: if img.get_storage_type() == gtk.IMAGE_ANIMATION:
self.plugin.windows[account]['chats'][user.jid].\ self.plugin.windows[account]['chats'][user.jid].\
img.set_from_animation(img.get_animation()) img.set_from_animation(img.get_animation())