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


Commits:
a3065bc5 by lovetox at 2022-06-18T15:29:00+02:00
fix: Discovery: Remove obsolete code

- - - - -
910a9109 by lovetox at 2022-06-18T15:29:25+02:00
fix: Restore minimal AdHoc module

- - - - -


2 changed files:

- + gajim/common/modules/adhoc_commands.py
- gajim/common/modules/discovery.py


Changes:

=====================================
gajim/common/modules/adhoc_commands.py
=====================================
@@ -0,0 +1,30 @@
+# This file is part of Gajim.
+#
+# Gajim is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation; version 3 only.
+#
+# Gajim is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import annotations
+
+from gajim.common import types
+from gajim.common.modules.base import BaseModule
+
+
+class AdHocCommands(BaseModule):
+
+    _nbxmpp_extends = 'AdHoc'
+    _nbxmpp_methods = [
+        'request_command_list',
+        'execute_command',
+    ]
+
+    def __init__(self, con: types.Client) -> None:
+        BaseModule.__init__(self, con)


=====================================
gajim/common/modules/discovery.py
=====================================
@@ -185,19 +185,12 @@ def _answer_disco_items(self,
         from_ = stanza.getFrom()
         self._log.info('Answer disco items to %s', from_)
 
-        if self._con.get_module('AdHocCommands').command_items_query(stanza):
-            raise nbxmpp.NodeProcessed
-
         node = stanza.getTagAttr('query', 'node')
         if node is None:
             result = stanza.buildReply('result')
             self._con.connection.send(result)
             raise nbxmpp.NodeProcessed
 
-        if node == Namespace.COMMANDS:
-            self._con.get_module('AdHocCommands').command_list_query(stanza)
-            raise nbxmpp.NodeProcessed
-
     def _answer_disco_info(self,
                            _con: types.xmppClient,
                            stanza: Iq,
@@ -209,9 +202,6 @@ def _answer_disco_info(self,
             # Service that echos all stanzas, ignore it
             raise nbxmpp.NodeProcessed
 
-        if self._con.get_module('AdHocCommands').command_info_query(stanza):
-            raise nbxmpp.NodeProcessed
-
     @as_task
     def disco_muc(self,
                   jid: Union[JID, str],



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/4648f0bbbc3920bdac5dae36a826de8ae191463d...910a9109f3e9e9f419ef05597cf04e31794737e6

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/4648f0bbbc3920bdac5dae36a826de8ae191463d...910a9109f3e9e9f419ef05597cf04e31794737e6
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to