Philipp Hörist pushed to branch mainwindow at gajim / gajim
Commits: b8d30875 by lovetox at 2021-03-01T17:41:28+01:00 Add room-left signal - - - - - 57394b05 by lovetox at 2021-03-01T17:46:08+01:00 Fix muc user avatar update - - - - - 3 changed files: - gajim/common/modules/contacts.py - gajim/common/modules/muc.py - gajim/gui_interface.py Changes: ===================================== gajim/common/modules/contacts.py ===================================== @@ -147,10 +147,6 @@ def get_resource(self, resource): contact = self.add_resource(resource) return contact - # @property - # def groups(self): - # return self._module('Roster').get_groups(self._jid) - @property def is_available(self): return any([contact.is_available for contact in self._resources.values()]) @@ -333,7 +329,7 @@ def update_avatar(self, *args): def set_not_joined(self): for contact in self._resources.values(): - contact.update_presence(UNKNOWN_MUC_PRESENCE) + contact.update_presence(UNKNOWN_MUC_PRESENCE, notify=False) def get_user_nicknames(self): client = app.get_client(self._account) @@ -411,7 +407,11 @@ def get_avatar(self, return app.interface.avatar_storage.get_surface( self, size, scale, show, style=style) - def update_presence(self, presence, *args): + def update_presence(self, presence, *args, notify=True): + if not notify: + self._presence = presence + return + if not self._presence.available and presence.available: self._presence = presence self.notify('user-joined', *args) @@ -443,7 +443,7 @@ def set_state(self, state, presence): def update_avatar(self, *args): app.interface.avatar_storage.invalidate_cache(self._jid) - self.notify('avatar-update') + self.notify('user-avatar-update') def get_instance(*args: Any, **kwargs: Any) -> Tuple[Contacts, str]: ===================================== gajim/common/modules/muc.py ===================================== @@ -261,6 +261,7 @@ def leave(self, room_jid, reason=None): self._manager.set_state(room_jid, MUCJoinedState.NOT_JOINED) room = self._get_contact(room_jid) room.set_not_joined() + room.notify('room-left') def configure_room(self, room_jid): self._nbxmpp('MUC').request_config(room_jid, @@ -825,8 +826,9 @@ def reset_state(self): for muc in self._mucs.values(): self.set_state(muc.jid, MUCJoinedState.NOT_JOINED) self._joined_users.pop(muc.jid, None) - contact = client.get_module('Contacts').get_contact(muc.jid) - contact.set_not_joined() + room = client.get_module('Contacts').get_contact(muc.jid) + room.set_not_joined() + room.notify('room-left') def __contains__(self, room_jid): return room_jid in self._mucs ===================================== gajim/gui_interface.py ===================================== @@ -186,8 +186,7 @@ def _response(account, answer): args=[obj, 'yes'])]).show() def handle_event_iq_error(self, event): - ctrl = self.msg_win_mgr.get_control(event.properties.jid.bare, - event.account) + ctrl = app.window.get_control(event.account, event.properties.jid.bare) if ctrl and ctrl.is_groupchat: ctrl.add_info_message('Error: %s' % event.properties.error) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/6d5e9c5f5ce4980aab8a8e9a43ca01091eab1a7c...57394b050dda6ed9140c740ce2b0d01744b2d6f3 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/6d5e9c5f5ce4980aab8a8e9a43ca01091eab1a7c...57394b050dda6ed9140c740ce2b0d01744b2d6f3 You're receiving this email because of your account on dev.gajim.org.
_______________________________________________ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits