quick frontend (chat): fixed messageNew signal dispatching when several widgets are handling the target
This commit is contained in:
parent
8a7029b549
commit
caaa753d80
2 changed files with 6 additions and 5 deletions
|
|
@ -479,7 +479,8 @@ class QuickApp(object):
|
||||||
from_me = from_jid.bare == self.profiles[profile].whoami.bare
|
from_me = from_jid.bare == self.profiles[profile].whoami.bare
|
||||||
target = to_jid if from_me else from_jid
|
target = to_jid if from_me else from_jid
|
||||||
contact_list = self.contact_lists[profile]
|
contact_list = self.contact_lists[profile]
|
||||||
chat_widget = self.widgets.getOrCreateWidget(quick_chat.QuickChat, target, type_=C.CHAT_ONE2ONE, on_new_widget=None, profile=profile)
|
# we want to be sure to have at least one QuickChat instance
|
||||||
|
self.widgets.getOrCreateWidget(quick_chat.QuickChat, target, type_=C.CHAT_ONE2ONE, on_new_widget=None, profile=profile)
|
||||||
|
|
||||||
self.current_action_ids = set() # FIXME: to be removed
|
self.current_action_ids = set() # FIXME: to be removed
|
||||||
self.current_action_ids_cb = {} # FIXME: to be removed
|
self.current_action_ids_cb = {} # FIXME: to be removed
|
||||||
|
|
@ -489,9 +490,9 @@ class QuickApp(object):
|
||||||
# presence information and which are not in roster
|
# presence information and which are not in roster
|
||||||
contact_list.setContact(from_jid)
|
contact_list.setContact(from_jid)
|
||||||
|
|
||||||
# we display the message in the widget
|
# we dispatch the message in the widgets
|
||||||
|
for widget in self.widgets.getWidgets(quick_chat.QuickChat, target=target, profiles=(profile,)):
|
||||||
chat_widget.messageNew(uid, timestamp, from_jid, target, msg, subject, type_, extra, profile)
|
widget.messageNew(uid, timestamp, from_jid, target, msg, subject, type_, extra, profile)
|
||||||
|
|
||||||
def messageStateHandler(self, uid, status, profile):
|
def messageStateHandler(self, uid, status, profile):
|
||||||
for widget in self.widgets.getWidgets(quick_chat.QuickChat, profiles=(profile,)):
|
for widget in self.widgets.getWidgets(quick_chat.QuickChat, profiles=(profile,)):
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ class Occupant(object):
|
||||||
|
|
||||||
class QuickChat(quick_widgets.QuickWidget):
|
class QuickChat(quick_widgets.QuickWidget):
|
||||||
|
|
||||||
visible_states = ['chat_state']
|
visible_states = ['chat_state'] # FIXME: to be removed, used only in quick_games
|
||||||
|
|
||||||
def __init__(self, host, target, type_=C.CHAT_ONE2ONE, occupants=None, subject=None, profiles=None):
|
def __init__(self, host, target, type_=C.CHAT_ONE2ONE, occupants=None, subject=None, profiles=None):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue