Mercurial > libervia-web
comparison libervia.py @ 304:2ab513a47e3b
browser_side: fix presence/status update (do not share between different resources)
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 18 Dec 2013 09:54:27 +0100 |
parents | e4f586fc6101 |
children | 05e264e96a1c |
comparison
equal
deleted
inserted
replaced
303:6ce8515ee8f5 | 304:2ab513a47e3b |
---|---|
625 else: | 625 else: |
626 # The message has not been showed, we must indicate it | 626 # The message has not been showed, we must indicate it |
627 self.contact_panel.setContactMessageWaiting(other.bare, True) | 627 self.contact_panel.setContactMessageWaiting(other.bare, True) |
628 | 628 |
629 def _presenceUpdateCb(self, entity, show, priority, statuses): | 629 def _presenceUpdateCb(self, entity, show, priority, statuses): |
630 _entity = JID(entity) | 630 entity_jid = JID(entity) |
631 #XXX: QnD way to get our status | 631 if self.whoami and self.whoami == entity_jid: # XXX: QnD way to get our presence/status |
632 if self.whoami and self.whoami.bare == _entity.bare and statuses: | |
633 self.status_panel.setPresence(show) | 632 self.status_panel.setPresence(show) |
634 self.status_panel.changeStatus(statuses.values()[0]) | 633 if statuses: |
635 if (not self.whoami or self.whoami.bare != _entity.bare): | 634 self.status_panel.changeStatus(statuses.values()[0]) |
636 self.contact_panel.setConnected(_entity.bare, _entity.resource, show, priority, statuses) | 635 else: |
636 self.contact_panel.setConnected(entity_jid.bare, entity_jid.resource, show, priority, statuses) | |
637 | 637 |
638 def _roomJoinedCb(self, room_jid, room_nicks, user_nick): | 638 def _roomJoinedCb(self, room_jid, room_nicks, user_nick): |
639 _target = JID(room_jid) | 639 _target = JID(room_jid) |
640 if _target not in self.room_list: | 640 if _target not in self.room_list: |
641 self.room_list.append(_target) | 641 self.room_list.append(_target) |