plugin XEP-0085, quick_frontends, primitivus: chat states are working again

This commit is contained in:
Goffi 2016-07-17 16:47:33 +02:00
commit cc160e03d7

View file

@ -569,20 +569,9 @@ class QuickApp(object):
@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