Philipp Hörist pushed to branch master at gajim / gajim


Commits:
4ad5e6cd by wurstsalat at 2025-03-15T17:57:22+01:00
fix: MUC: Fix handling affiliation/role change error handling

- - - - -


1 changed file:

- gajim/gtk/chat_stack.py


Changes:

=====================================
gajim/gtk/chat_stack.py
=====================================
@@ -6,7 +6,6 @@
 
 import logging
 import sys
-from functools import partial
 from urllib.parse import urlparse
 
 from gi.repository import Gdk
@@ -639,9 +638,8 @@ def _on_action(self, action: Gio.SimpleAction, param: 
GLib.Variant | None) -> No
                 contact.jid,
                 nick,
                 role,
-                callback=partial(
-                    self._on_affiliation_or_role_change, contact, jid, role
-                ),
+                callback=self._on_affiliation_or_role_change,
+                user_data=(contact, jid, role),
             )
 
         elif action_name == "muc-change-affiliation":
@@ -651,9 +649,8 @@ def _on_action(self, action: Gio.SimpleAction, param: 
GLib.Variant | None) -> No
             client.get_module("MUC").set_affiliation(
                 contact.jid,
                 {jid: {"affiliation": affiliation}},
-                callback=partial(
-                    self._on_affiliation_or_role_change, contact, jid, 
affiliation
-                ),
+                callback=self._on_affiliation_or_role_change,
+                user_data=(contact, jid, affiliation),
             )
 
         elif action_name == "muc-request-voice":
@@ -670,13 +667,9 @@ def _on_action(self, action: Gio.SimpleAction, param: 
GLib.Variant | None) -> No
                 self._last_quoted_id = row.pk
                 self._message_action_box.insert_as_quote(row.get_text(), 
clear=True)
 
-    def _on_affiliation_or_role_change(
-        self,
-        muc: GroupchatContact,
-        jid: JID | str,
-        affiliation_or_role: str,
-        task: Task,
-    ) -> None:
+    def _on_affiliation_or_role_change(self, task: Task) -> None:
+        muc, jid, affiliation_or_role = task.get_user_data()
+
         try:
             result = task.finish()
         except StanzaError as error:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/4ad5e6cdba4d1e634d8d5b1ebe0129429b6b8df2

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


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to