diff cagou/core/cagou_main.py @ 244:5bd94bc08f5c

plugin chat: fixed OTR State filtering + removed some legacy code
author Goffi <goffi@goffi.org>
date Thu, 03 Jan 2019 20:38:46 +0100
parents f555b10712d7
children 15e47bbb192c
line wrap: on
line diff
--- a/cagou/core/cagou_main.py	Thu Jan 03 20:37:55 2019 +0100
+++ b/cagou/core/cagou_main.py	Thu Jan 03 20:38:46 2019 +0100
@@ -29,6 +29,7 @@
 from sat_frontends.quick_frontend import quick_widgets
 from sat_frontends.quick_frontend import quick_chat
 from sat_frontends.quick_frontend import quick_utils
+from sat_frontends.tools import jid
 from sat.tools import config
 from sat.tools.common import dynamic_import
 import kivy
@@ -738,8 +739,11 @@
         """OTR state has changed for on destinee"""
         # XXX: this method could be in QuickApp but it's here as
         #      it's only used by Cagou so far
+        dest_jid = jid.JID(dest_jid)
+        bare_jid = dest_jid.bare
         for widget in self.widgets.getWidgets(quick_chat.QuickChat, profiles=(profile,)):
-            widget.onOTRState(state, dest_jid, profile)
+            if widget.type == C.CHAT_ONE2ONE and widget.target == bare_jid:
+                widget.onOTRState(state, dest_jid, profile)
 
     ## misc ##