diff options
author | wurstsalat <mailtrash@posteo.de> | 2023-10-24 23:53:20 +0300 |
---|---|---|
committer | wurstsalat <mailtrash@posteo.de> | 2023-10-24 23:53:23 +0300 |
commit | 4fd5f6a091cf73f8ed10d1a67b0edf4ea1cefc83 (patch) | |
tree | 1d83e4521629a02e2e0fd598ff13fe6d6c4afdb3 | |
parent | 78315d84de5db2148db30126ff837ea6f4adb8a2 (diff) |
imprv: ChatBanner: Don't show QR code for privated MUCs
Fixes #11647
-rw-r--r-- | gajim/gtk/chat_banner.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gajim/gtk/chat_banner.py b/gajim/gtk/chat_banner.py index b42b25b4d..eba89d574 100644 --- a/gajim/gtk/chat_banner.py +++ b/gajim/gtk/chat_banner.py @@ -393,15 +393,24 @@ class ChatBanner(Gtk.Box, EventHelper): def _on_share_clicked(self, _button: Gtk.Button) -> None: assert self._contact is not None - if self._contact.is_groupchat: + if isinstance(self._contact, GroupchatContact): share_text = _('Scan this QR code to join %s.') + if self._contact.muc_context == 'private': + share_text = _('%s can be joined by invite only.') else: share_text = _('Scan this QR code to start a chat with %s.') self._ui.share_instructions.set_text(share_text % self._contact.name) + if (isinstance(self._contact, GroupchatContact) and + self._contact.muc_context == 'private'): + # Don't display QR code for private MUCs (they require an invite) + self._ui.qr_code_image.hide() + return + # Generate QR code on demand (i.e. not when switching chats) self._ui.qr_code_image.set_from_pixbuf( generate_qr_code(self._get_share_uri())) + self._ui.qr_code_image.show() def _on_copy_jid_clicked(self, _button: Gtk.Button) -> None: text = self._get_share_uri() |