On 04/18/2016 09:52 AM, Thomas Keller wrote:
> On 2016-04-17 17:18, Yann Leboulanger wrote:
>> On 04/17/2016 04:17 PM, Thomas Keller wrote:
>>> whenever I write a message starting with /, gajim thinks I am referring
>>> to a file on my filesystem, and tells me:
>>>
>> Hi,
>>
>> This is our c. All messages starting with a / are
>> considered as a command. Gajim doesn't think it's a file on your system,
>> it thinks it's a command. (type /help -a to see a list of available
>> commands)
>>
>> There is no way to disable that. you just need to double the first / if
>> your message starts with a /.
>>
> there must be some way to disable it in the python code. Could somebody
> please point me to the relevant section of the code ?
>
> I don't see any reason why I would want to mix using "command system"
> when writing messages. And choosing "/" do delimit commands seems very
> unfortunate to me, if I may give unsolicited feedback.

Here is a patch to disable commands in chat. Same kind of thing should
be done in groupchat_controle.py

diff -r d02b76c94c5e src/chat_control.py
--- a/src/chat_control.py	Sun Apr 17 20:31:19 2016 +0200
+++ b/src/chat_control.py	Mon Apr 18 22:13:28 2016 +0200
@@ -60,15 +60,6 @@
 from common.connection_handlers_events import MessageOutgoingEvent
 from common.exceptions import GajimGeneralException
 
-from command_system.implementation.middleware import ChatCommandProcessor
-from command_system.implementation.middleware import CommandTools
-from command_system.implementation.hosts import ChatCommands
-
-# Here we load the module with the standard commands, so they are being detected
-# and dispatched.
-from command_system.implementation.standard import StandardChatCommands
-from command_system.implementation.execute import Execute, Show
-
 try:
     import gtkspell
     HAS_GTK_SPELL = True
@@ -81,7 +72,7 @@
     import remote_control
 
 ################################################################################
-class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
+class ChatControlBase(MessageControl):
     """
     A base class containing a banner, ConversationTextview, MessageTextView
     """
@@ -477,10 +468,6 @@
         gajim.ged.register_event_handler('ping-error', ged.GUI1,
             self._nec_ping_error)
 
-        # This is bascially a very nasty hack to surpass the inability
-        # to properly use the super, because of the old code.
-        CommandTools.__init__(self)
-
     def set_speller(self):
         # now set the one the user selected
         per_type = 'contacts'
@@ -845,9 +832,6 @@
         if not message or message == '\n':
             return None
 
-        if process_commands and self.process_as_command(message):
-            return
-
         label = self.get_seclabel()
 
         def _cb(msg, cb, *cb_args):
@@ -1450,10 +1434,6 @@
     TYPE_ID = message_control.TYPE_CHAT
     old_msg_kind = None # last kind of the printed message
 
-    # Set a command host to bound to. Every command given through a chat will be
-    # processed with this command host.
-    COMMAND_HOST = ChatCommands
-
     def __init__(self, parent_win, contact, acct, session, resource=None):
         ChatControlBase.__init__(self, self.TYPE_ID, parent_win,
             'chat_control', contact, acct, resource)
_______________________________________________
Gajim-devel mailing list
Gajim-devel@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/gajim-devel

Reply via email to