Author: jim++ Date: 2007-02-08 20:08:44 +0100 (Thu, 08 Feb 2007) New Revision: 7958
Modified: trunk/src/groupchat_control.py Log: Do NOT save muc_cmds list for every gc_control instance
Modified: trunk/src/groupchat_control.py =================================================================== --- trunk/src/groupchat_control.py 2007-02-08 18:33:42 UTC (rev 7957) +++ trunk/src/groupchat_control.py 2007-02-08 19:08:44 UTC (rev 7958) @@ -137,6 +137,10 @@
class GroupchatControl(ChatControlBase): TYPE_ID = message_control.TYPE_GC + # alphanum sorted + MUC_CMDS = ['ban', 'chat', 'query', 'clear', 'close', 'compact', + 'help', 'invite', 'join', 'kick', 'leave', 'me', 'msg', 'nick', + 'part', 'names', 'say', 'topic']
def __init__(self, parent_win, contact, acct): ChatControlBase.__init__(self, self.TYPE_ID, parent_win, @@ -187,10 +191,7 @@ gajim.config.get('hide_groupchat_occupants_list'))
self._last_selected_contact = None # None or holds jid, account tuple - # alphanum sorted - self.muc_cmds = ['ban', 'chat', 'query', 'clear', 'close', 'compact', - 'help', 'invite', 'join', 'kick', 'leave', 'me', 'msg', 'nick', - 'part', 'names', 'say', 'topic'] + # muc attention flag (when we are mentioned in a muc) # if True, the room has mentioned us self.attention_flag = False @@ -1255,7 +1256,8 @@
def get_command_help(self, command): if command == 'help': - self.print_conversation(_('Commands: %s') % self.muc_cmds, 'info') + self.print_conversation(_('Commands: %s') % GroupchatControl.MUC_CMDS, + 'info') elif command == 'ban': s = _('Usage: /%s <nickname|JID> [reason], bans the JID from the group chat.' ' The nickname of an occupant may be substituted, but not if it ' @@ -1503,7 +1505,7 @@ if text.startswith('/') and len(splitted_text) == 1: text = splitted_text[0] if len(text) == 1: # user wants to cycle all commands - self.cmd_hits = self.muc_cmds + self.cmd_hits = GroupchatControl.MUC_CMDS else: # cycle possible commands depending on what the user typed if self.last_key_tabs and len(self.cmd_hits) and \ @@ -1512,7 +1514,7 @@ self.cmd_hits.pop(0) else: # find possible commands self.cmd_hits = [] - for cmd in self.muc_cmds: + for cmd in GroupchatControl.MUC_CMDS: if cmd.startswith(text.lstrip('/')): self.cmd_hits.append(cmd) if len(self.cmd_hits):