Mercurial > libervia-web
comparison src/browser/sat_browser/plugin_sec_otr.py @ 616:1c0d5a87c554 frontends_multi_profiles
browser_side: add and use method displayWidget to harmonize widget's management in Libervia (not completely done, there are some issues)
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 11 Feb 2015 11:18:13 +0100 |
parents | a5019e62c3e9 |
children | 9092e624bb27 |
comparison
equal
deleted
inserted
replaced
615:70872a83ef15 | 616:1c0d5a87c554 |
---|---|
30 | 30 |
31 from constants import Const as C | 31 from constants import Const as C |
32 from sat_frontends.tools import jid | 32 from sat_frontends.tools import jid |
33 import otrjs_wrapper as otr | 33 import otrjs_wrapper as otr |
34 import dialog | 34 import dialog |
35 import panels | 35 import chat |
36 | 36 |
37 | 37 |
38 NS_OTR = "otr_plugin" | 38 NS_OTR = "otr_plugin" |
39 PRIVATE_KEY = "PRIVATE KEY" | 39 PRIVATE_KEY = "PRIVATE KEY" |
40 MAIN_MENU = D_('OTR encryption') | 40 MAIN_MENU = D_('OTR encryption') |
447 def cb(jid_): | 447 def cb(jid_): |
448 otrctx = self.context_manager.getContextForUser(jid_, start=False) | 448 otrctx = self.context_manager.getContextForUser(jid_, start=False) |
449 if otrctx is None: | 449 if otrctx is None: |
450 def confirm(confirm): | 450 def confirm(confirm): |
451 if confirm: | 451 if confirm: |
452 self.host.getOrCreateLiberviaWidget(panels.ChatPanel, {'item': jid_}) | 452 self.host.displayWidget(chat.Chat, jid_) |
453 decrypt(self.context_manager.startContext(jid_)) | 453 decrypt(self.context_manager.startContext(jid_)) |
454 else: | 454 else: |
455 # FIXME: plain text messages with whitespaces would be lost here when WHITESPACE_START_AKE is True | 455 # FIXME: plain text messages with whitespaces would be lost here when WHITESPACE_START_AKE is True |
456 pass | 456 pass |
457 key = self.context_manager.account.privkey | 457 key = self.context_manager.account.privkey |