update pm chat window when a gc contact change his status
This commit is contained in:
parent
6ed018c93e
commit
7612ad7c64
33
src/gajim.py
33
src/gajim.py
|
@ -700,17 +700,30 @@ class Interface:
|
||||||
self.remote_ctrl.raise_signal('OsInfo', (account, array))
|
self.remote_ctrl.raise_signal('OsInfo', (account, array))
|
||||||
|
|
||||||
def handle_event_gc_notify(self, account, array):
|
def handle_event_gc_notify(self, account, array):
|
||||||
#('GC_NOTIFY', account, (jid, status, message, resource,
|
#('GC_NOTIFY', account, (room_jid, show, status, nick,
|
||||||
# role, affiliation, jid, reason, actor, statusCode, newNick))
|
# role, affiliation, jid, reason, actor, statusCode, newNick))
|
||||||
jid = array[0].split('/')[0]
|
nick = array[3]
|
||||||
resource = array[3]
|
if not nick:
|
||||||
if not resource:
|
return
|
||||||
resource = ''
|
room_jid = array[0]
|
||||||
if self.instances[account]['gc'].has_key(jid): # ji is then room_jid
|
fjid = room_jid + '/' + nick
|
||||||
#FIXME: upgrade the chat instances (for pm)
|
show = array[1]
|
||||||
#FIXME: real_jid can be None
|
status = array[2]
|
||||||
self.instances[account]['gc'][jid].chg_contact_status(jid, resource,
|
# print status in chat window and update status/GPG image
|
||||||
array[1], array[2], array[4], array[5], array[6], array[7],
|
if self.instances[account]['chats'].has_key(fjid):
|
||||||
|
contact = self.instances[account]['chats'][fjid].contacts[fjid]
|
||||||
|
contact.show = show
|
||||||
|
contact.status = status
|
||||||
|
self.instances[account]['chats'][fjid].set_state_image(fjid)
|
||||||
|
uf_show = helpers.get_uf_show(show)
|
||||||
|
self.instances[account]['chats'][fjid].print_conversation(
|
||||||
|
_('%s is now %s (%s)') % (nick, uf_show, status), fjid,
|
||||||
|
'status')
|
||||||
|
self.instances[account]['chats'][fjid].draw_name_banner(contact)
|
||||||
|
|
||||||
|
if self.instances[account]['gc'].has_key(room_jid):
|
||||||
|
self.instances[account]['gc'][room_jid].chg_contact_status(room_jid,
|
||||||
|
nick, show, status, array[4], array[5], array[6], array[7],
|
||||||
array[8], array[9], array[10], account)
|
array[8], array[9], array[10], account)
|
||||||
if self.remote_ctrl:
|
if self.remote_ctrl:
|
||||||
self.remote_ctrl.raise_signal('GCPresence', (account, array))
|
self.remote_ctrl.raise_signal('GCPresence', (account, array))
|
||||||
|
|
Loading…
Reference in New Issue