quick_frontend(app): fixed use of bare jid for target when getting a new message:
in newMessage handler, full jid was sometime used for target, while is should always be bare jid. Full jid is used in the messageNew method of each widget.
This commit is contained in:
parent
3830c1c176
commit
93ac4db950
1 changed files with 7 additions and 15 deletions
|
|
@ -702,32 +702,24 @@ class QuickApp(object):
|
|||
from_jid = jid.JID(from_jid_s)
|
||||
to_jid = jid.JID(to_jid_s)
|
||||
if not self.trigger.point(
|
||||
"messageNewTrigger",
|
||||
uid,
|
||||
timestamp,
|
||||
from_jid,
|
||||
to_jid,
|
||||
msg,
|
||||
subject,
|
||||
type_,
|
||||
extra,
|
||||
profile=profile,
|
||||
):
|
||||
"messageNewTrigger", uid, timestamp, from_jid, to_jid, msg, subject, type_,
|
||||
extra, profile=profile,):
|
||||
return
|
||||
|
||||
from_me = from_jid.bare == self.profiles[profile].whoami.bare
|
||||
target = to_jid if from_me else from_jid
|
||||
mess_to_jid = to_jid if from_me else from_jid
|
||||
target = mess_to_jid.bare
|
||||
contact_list = self.contact_lists[profile]
|
||||
|
||||
try:
|
||||
is_room = contact_list.isRoom(target.bare)
|
||||
is_room = contact_list.isRoom(target)
|
||||
except exceptions.NotFound:
|
||||
is_room = False
|
||||
|
||||
if target.resource and not is_room:
|
||||
# we avoid resource locking, but we must keep resource for private MUC
|
||||
# messages
|
||||
target = target.bare
|
||||
target = target
|
||||
# we want to be sure to have at least one QuickChat instance
|
||||
self.widgets.getOrCreateWidget(
|
||||
quick_chat.QuickChat,
|
||||
|
|
@ -750,7 +742,7 @@ class QuickApp(object):
|
|||
quick_chat.QuickChat, target=target, profiles=(profile,)
|
||||
):
|
||||
widget.messageNew(
|
||||
uid, timestamp, from_jid, target, msg, subject, type_, extra, profile
|
||||
uid, timestamp, from_jid, mess_to_jid, msg, subject, type_, extra, profile
|
||||
)
|
||||
|
||||
def messageEncryptionStartedHandler(self, destinee_jid_s, plugin_data, profile):
|
||||
|
|
|
|||
Loading…
Reference in a new issue