diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tabs.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tabs.py b/src/tabs.py index 168a0459..db534a72 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -802,6 +802,11 @@ class MucTab(ChatTab): self.register_command('names', self.command_names, desc=_('Get the list of the users in the room, and the list of the people assuming the different roles.'), shortdesc=_('List the users.')) + self.register_command('invite', self.command_invite, + desc=_('Invite a contact to this room'), + usage=_('<jid> [reason]'), + shortdesc=_('Invite a contact to this room'), + completion=self.completion_invite) if self.core.xmpp.boundjid.server == "gmail.com": #gmail sucks del self.commands["nick"] @@ -895,6 +900,23 @@ class MucTab(ChatTab): possible_affiliations = ['none', 'member', 'admin', 'owner', 'outcast'] return the_input.new_completion(possible_affiliations, 2, '', quotify=True) + def command_invite(self, args): + """/invite <jid> [reason]""" + args = common.shell_split(args) + if len(args) == 1: + jid, reason = args[0], '' + elif len(args) == 2: + jid, reason = args + else: + return self.core.command_help('invite') + self.core.command_invite('%s %s "%s"' % (jid, self.name, reason)) + + def completion_invite(self, the_input): + """Completion for /invite""" + n = the_input.get_argument_position(quoted=True) + if n == 1: + return the_input.new_completion(roster.jids(), 1, quotify=True) + def scroll_user_list_up(self): self.user_win.scroll_up() self.user_win.refresh(self.users) |