Daniel Brötzmann pushed to branch mainwindow at gajim / gajim


Commits:
610db714 by wurstsalat at 2021-11-03T00:54:33+01:00
GroupChat: Add check for IRC

- - - - -


1 changed file:

- gajim/gtk/controls/groupchat.py


Changes:

=====================================
gajim/gtk/controls/groupchat.py
=====================================
@@ -40,7 +40,8 @@
 from gi.repository import GLib
 from gi.repository import Gio
 
-from gajim import gui_menu_builder
+from gajim.gui_menu_builder import get_encryption_menu
+from gajim.gui_menu_builder import get_groupchat_menu
 
 from gajim.common import app
 from gajim.common import ged
@@ -142,8 +143,8 @@ def __init__(self, account, jid):
         # Encryption
         self.set_lock_image()
 
-        self.xml.encryption_menu.set_menu_model(
-            gui_menu_builder.get_encryption_menu(self.control_id, self._type))
+        self.xml.encryption_menu.set_menu_model(get_encryption_menu(
+            self.control_id, self._type))
         self.set_encryption_menu_icon()
 
         # Banner
@@ -175,9 +176,9 @@ def __init__(self, account, jid):
         self.xml.invite_grid.attach(self._invite_box, 0, 0, 1, 1)
         self._invite_box.connect('listbox-changed', self._on_invite_ready)
 
-        self.control_menu = 
gui_menu_builder.get_groupchat_menu(self.control_id,
-                                                                self.account,
-                                                                self.room_jid)
+        self.control_menu = get_groupchat_menu(self.control_id,
+                                               self.account,
+                                               self.room_jid)
 
         self.xml.settings_menu.set_menu_model(self.control_menu)
 
@@ -322,7 +323,8 @@ def update_actions(self, *args):
                                                         subject_change)
 
         # Change Nick
-        self._get_action('change-nickname-').set_enabled(joined)
+        self._get_action('change-nickname-').set_enabled(
+            joined and not self.is_irc())
 
         # Execute command
         self._get_action('execute-command-').set_enabled(joined)
@@ -391,6 +393,11 @@ def remove_actions(self):
         for action in actions:
             app.window.remove_action(f'{action}{self.control_id}')
 
+    def is_irc(self) -> bool:
+        if self.disco_info is None:
+            return False
+        return self.disco_info.is_irc
+
     def _is_subject_change_allowed(self):
         contact = self.contact.get_self()
         if contact is None:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/610db7143630307febeaa2d81e3038978ad1dfd1

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/610db7143630307febeaa2d81e3038978ad1dfd1
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to