comparison sat_frontends/quick_frontend/quick_app.py @ 2586:57c8c155192f

quick frontend (app): avoid resource locking on new message
author Goffi <goffi@goffi.org>
date Fri, 11 May 2018 20:06:06 +0200
parents 2e6864b1d577
children bd9d92bc0d6c
comparison
equal deleted inserted replaced
2585:0112c1f7dcf0 2586:57c8c155192f
533 return 533 return
534 534
535 from_me = from_jid.bare == self.profiles[profile].whoami.bare 535 from_me = from_jid.bare == self.profiles[profile].whoami.bare
536 target = to_jid if from_me else from_jid 536 target = to_jid if from_me else from_jid
537 contact_list = self.contact_lists[profile] 537 contact_list = self.contact_lists[profile]
538 if target.resource and not contact_list.isRoom(target.bare):
539 # we avoid resource locking, but we must keep resource for private MUC messages
540 target = target.bare
538 # we want to be sure to have at least one QuickChat instance 541 # we want to be sure to have at least one QuickChat instance
539 self.widgets.getOrCreateWidget(quick_chat.QuickChat, target, type_=C.CHAT_ONE2ONE, on_new_widget=None, profile=profile) 542 self.widgets.getOrCreateWidget(quick_chat.QuickChat, target, type_=C.CHAT_ONE2ONE, on_new_widget=None, profile=profile)
540 543
541 if not from_jid in contact_list and from_jid.bare != self.profiles[profile].whoami.bare: 544 if not from_jid in contact_list and from_jid.bare != self.profiles[profile].whoami.bare:
542 #XXX: needed to show entities which haven't sent any 545 #XXX: needed to show entities which haven't sent any