comparison 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
comparison
equal deleted inserted replaced
2006:0ddf3edf643a 2007:19b9d3f8a6c7
567 567
568 @param from_jid_s (unicode): JID of a contact or C.ENTITY_ALL 568 @param from_jid_s (unicode): JID of a contact or C.ENTITY_ALL
569 @param state (unicode): new state 569 @param state (unicode): new state
570 @param profile (unicode): current profile 570 @param profile (unicode): current profile
571 """ 571 """
572 # log.debug(_(u"Received new chat state {} from {} [{}]").format(state, from_jid_s, profile)) 572 from_jid = jid.JID(from_jid_s)
573 # from_jid = jid.JID(from_jid_s) if from_jid_s != C.ENTITY_ALL else C.ENTITY_ALL 573 for widget in self.widgets.getWidgets(quick_chat.QuickChat, profiles=(profile,)):
574 # contact_list = self.contact_lists[profile] 574 widget.onChatState(from_jid, state, profile)
575 # for widget in self.widgets.getWidgets(quick_chat.QuickChat):
576 # if profile != widget.profile:
577 # continue
578 # to_display = C.USER_CHAT_STATES[state] if (state and widget.type == C.CHAT_GROUP) else state
579 # if widget.type == C.CHAT_GROUP and from_jid_s == C.ENTITY_ALL:
580 # for occupant in [jid.newResource(widget.target, nick) for nick in widget.occupants]:
581 # contact_list.setCache(occupant, 'chat_state', to_display)
582 # widget.update(occupant)
583 # elif from_jid.bare == widget.target.bare: # roster contact or MUC occupant
584 # contact_list.setCache(from_jid, 'chat_state', to_display)
585 # widget.update(from_jid)
586 575
587 def notify(self, type_, entity=None, message=None, subject=None, callback=None, cb_args=None, widget=None, profile=C.PROF_KEY_NONE): 576 def notify(self, type_, entity=None, message=None, subject=None, callback=None, cb_args=None, widget=None, profile=C.PROF_KEY_NONE):
588 """Trigger an event notification 577 """Trigger an event notification
589 578
590 @param type_(unicode): notifation kind, 579 @param type_(unicode): notifation kind,