Mercurial > libervia-backend
diff frontends/src/quick_frontend/quick_app.py @ 2007:19b9d3f8a6c7
plugin XEP-0085, quick_frontends, primitivus: chat states are working again
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 17 Jul 2016 16:47:33 +0200 |
parents | 02d21a589be2 |
children | 90134b2e3dc4 |
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py Fri Jul 15 22:13:09 2016 +0200 +++ b/frontends/src/quick_frontend/quick_app.py Sun Jul 17 16:47:33 2016 +0200 @@ -569,20 +569,9 @@ @param state (unicode): new state @param profile (unicode): current profile """ - # log.debug(_(u"Received new chat state {} from {} [{}]").format(state, from_jid_s, profile)) - # from_jid = jid.JID(from_jid_s) if from_jid_s != C.ENTITY_ALL else C.ENTITY_ALL - # contact_list = self.contact_lists[profile] - # for widget in self.widgets.getWidgets(quick_chat.QuickChat): - # if profile != widget.profile: - # continue - # to_display = C.USER_CHAT_STATES[state] if (state and widget.type == C.CHAT_GROUP) else state - # if widget.type == C.CHAT_GROUP and from_jid_s == C.ENTITY_ALL: - # for occupant in [jid.newResource(widget.target, nick) for nick in widget.occupants]: - # contact_list.setCache(occupant, 'chat_state', to_display) - # widget.update(occupant) - # elif from_jid.bare == widget.target.bare: # roster contact or MUC occupant - # contact_list.setCache(from_jid, 'chat_state', to_display) - # widget.update(from_jid) + from_jid = jid.JID(from_jid_s) + for widget in self.widgets.getWidgets(quick_chat.QuickChat, profiles=(profile,)): + widget.onChatState(from_jid, state, profile) def notify(self, type_, entity=None, message=None, subject=None, callback=None, cb_args=None, widget=None, profile=C.PROF_KEY_NONE): """Trigger an event notification