comparison cagou/plugins/plugin_wid_chat.py @ 339:63cdabdd032e

chat: show encryption button with group chats: If the group chat use real jids, an encryption button is shown, displaying only non directed encryption plugins (as directed encryption plugins can't be used with MUCs).
author Goffi <goffi@goffi.org>
date Mon, 30 Dec 2019 21:03:21 +0100
parents d4883f9576db
children 9688e5e9881e
comparison
equal deleted inserted replaced
338:d4883f9576db 339:63cdabdd032e
287 btn.bind( 287 btn.bind(
288 on_release=self.unencrypted, 288 on_release=self.unencrypted,
289 ) 289 )
290 self.add_widget(btn) 290 self.add_widget(btn)
291 for plugin in G.host.encryption_plugins: 291 for plugin in G.host.encryption_plugins:
292 if chat.type == C.CHAT_GROUP and plugin["directed"]:
293 # directed plugins can't work with group chat
294 continue
292 btn = EncryptionButton( 295 btn = EncryptionButton(
293 text=plugin['name'], 296 text=plugin['name'],
294 trust_button=True, 297 trust_button=True,
295 ) 298 )
296 btn.bind( 299 btn.bind(
424 self._hi_comp_dropdown = DropDown() 427 self._hi_comp_dropdown = DropDown()
425 self._hi_comp_allowed = True 428 self._hi_comp_allowed = True
426 cagou_widget.CagouWidget.__init__(self) 429 cagou_widget.CagouWidget.__init__(self)
427 transfer_btn = TransferButton(chat=self) 430 transfer_btn = TransferButton(chat=self)
428 self.headerInputAddExtra(transfer_btn) 431 self.headerInputAddExtra(transfer_btn)
429 if type_ == C.CHAT_ONE2ONE: 432 if (type_ == C.CHAT_ONE2ONE or "REALJID_PUBLIC" in statuses):
430 self.encryption_btn = EncryptionMainButton(self) 433 self.encryption_btn = EncryptionMainButton(self)
431 self.headerInputAddExtra(self.encryption_btn) 434 self.headerInputAddExtra(self.encryption_btn)
432 self.extra_menu = ExtraMenu(chat=self) 435 self.extra_menu = ExtraMenu(chat=self)
433 extra_btn = ExtraButton(chat=self) 436 extra_btn = ExtraButton(chat=self)
434 self.headerInputAddExtra(extra_btn) 437 self.headerInputAddExtra(extra_btn)