# HG changeset patch # User Goffi # Date 1546544326 -3600 # Node ID 5bd94bc08f5cb6884278ee8c083e701fe40d11f7 # Parent 50f7c000b4ae49c72bb75bf2e6504276ffe11f78 plugin chat: fixed OTR State filtering + removed some legacy code diff -r 50f7c000b4ae -r 5bd94bc08f5c cagou/core/cagou_main.py --- 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 ## diff -r 50f7c000b4ae -r 5bd94bc08f5c cagou/plugins/plugin_wid_chat.kv --- a/cagou/plugins/plugin_wid_chat.kv Thu Jan 03 20:37:55 2019 +0100 +++ b/cagou/plugins/plugin_wid_chat.kv Thu Jan 03 20:38:46 2019 +0100 @@ -168,16 +168,3 @@ Rectangle: pos: self.pos size: self.size - # EncryptionButton: - # size_hint: 1, None - # id: start_btn - # text: _(u"Start/Refresh encrypted session") - # on_release: root.otr_start() - # EncryptionButton: - # size_hint: 1, None - # text: _(u"Finish encrypted session") - # on_release: root.otr_end() - # EncryptionButton: - # size_hint: 1, None - # text: _(u"Authenticate destinee") - # on_release: root.otr_authenticate() diff -r 50f7c000b4ae -r 5bd94bc08f5c cagou/plugins/plugin_wid_chat.py --- a/cagou/plugins/plugin_wid_chat.py Thu Jan 03 20:37:55 2019 +0100 +++ b/cagou/plugins/plugin_wid_chat.py Thu Jan 03 20:38:46 2019 +0100 @@ -48,7 +48,8 @@ "icon_symbol": u"chat", } -# following const are here temporary, they should move to quick frontend +# FIXME: OTR specific code is legacy, and only used nowadays for lock color +# we can probably get rid of them. OTR_STATE_UNTRUSTED = 'untrusted' OTR_STATE_TRUSTED = 'trusted' OTR_STATE_TRUST = (OTR_STATE_UNTRUSTED, OTR_STATE_TRUSTED)