From 9ce32c8211b4dc1ae69f5d803d7a6e084141e72c Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 16 Nov 2005 20:25:06 +0000 Subject: [PATCH] add a gc command: /say that send the message without looking for commands ("/say /help" sends "/help") --- src/groupchat_window.py | 12 +++++++++++- src/remote_control.py | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/groupchat_window.py b/src/groupchat_window.py index 50d5194f6..b786a879c 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -64,7 +64,7 @@ class GroupchatWindow(chat.Chat): # alphanum sorted self.muc_cmds = ['ban', 'chat', 'query', 'clear', 'close', 'compact', 'help', 'invite', - 'join', 'kick', 'leave', 'me', 'msg', 'nick', 'part', 'topic'] + 'join', 'kick', 'leave', 'me', 'msg', 'nick', 'part', 'say', 'topic'] self.nicks = {} # our nick for each groupchat we are in self.list_treeview = {} @@ -738,6 +738,8 @@ class GroupchatWindow(chat.Chat): message = message[1:] message_array = message.split(' ', 1) command = message_array.pop(0).lower() + if message_array = ['']: + message_array = [] if command == 'clear': # clear the groupchat window conv_textview.clear() @@ -891,6 +893,12 @@ class GroupchatWindow(chat.Chat): '/' + message) else: self.get_command_help(command) + elif command == 'say': + if len(message_array): + gajim.connections[self.account].send_gc_message(room_jid, + message[4:]) + else: + self.get_command_help(command) else: self.print_conversation(_('No such command: /%s') % command, room_jid) @@ -944,6 +952,8 @@ current room. Use third person. (e.g. /%s explodes.)') % elif command == 'topic': self.print_conversation(_('Usage: /%s [topic], displays or updates the \ current room topic.') % command, room_jid) + elif command == 'say': + self.print_conversation(_('Usage: /%s , sends a message without looking for other commands.') % command, room_jid) else: self.print_conversation(_('No help info for /%s') % command, room_jid) diff --git a/src/remote_control.py b/src/remote_control.py index 0746201a2..b93ae353d 100644 --- a/src/remote_control.py +++ b/src/remote_control.py @@ -35,6 +35,7 @@ try: except ImportError: _version = (0, 0, 0) +_version = (0,0,0) if _version >= (0, 41, 0): import dbus.service import dbus.glib # cause dbus 0.35+ doesn't return signal replies without it