diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-02-02 23:57:32 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-02-02 23:57:32 +0000 |
commit | 09099bed72a1c0cbc703646a87530580fc06bdbb (patch) | |
tree | 0e175ee6fa7fd04c60733bfba0aea3944174d37e /src | |
parent | 4b47768eced03ce4e2689e690780c89d5a176af8 (diff) | |
download | poezio-09099bed72a1c0cbc703646a87530580fc06bdbb.tar.gz poezio-09099bed72a1c0cbc703646a87530580fc06bdbb.tar.bz2 poezio-09099bed72a1c0cbc703646a87530580fc06bdbb.tar.xz poezio-09099bed72a1c0cbc703646a87530580fc06bdbb.zip |
fixed #1139
Diffstat (limited to 'src')
-rw-r--r-- | src/gui.py | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -176,6 +176,8 @@ class Gui(object): 'available': (self.command_avail, _('Usage: /available [message]\nAvailable: Sets your availability to available and (optional) sets your status message. This is equivalent to "/show available [message]"')), 'bookmark': (self.command_bookmark, _('Usage: /bookmark [roomname][/nick]\nBookmark: Bookmark the specified room (you will then auto-join it on each poezio start). This commands uses the same syntaxe as /nick. Type /help nick for syntaxe examples. Note that when typing "/bookmark" on its own, the room will be bookmarked with the nickname you\'re currently using in this room (instead of default_nick)')), 'set': (self.command_set, _('Usage: /set <option> <value>\nSet: Sets the value to the option in your configuration file. You can, for example, change your default nickname by doing `/set default_nick toto` or your resource with `/set resource`')), + 'kick': (self.command_kick, _('Usage: /kick <nick> [reason]\nKick: Kick the user with the specified nickname. You also can give an optional reason.')), + # 'ban': (self.command_ban, _('Usage: /ban <nick> [reason]\nBan: Ban the user with the specified nickname. You also can give an optional reason.')), 'nick': (self.command_nick, _('Usage: /nick <nickname>\nNick: Change your nickname in the current room')) } @@ -369,6 +371,34 @@ class Gui(object): self.window.text_win.refresh(room.name) self.window.input.refresh() + def command_kick(self, args): + if len(args) < 1: + self.command_help(['kick']) + return + nick = args[0] + if len(args) >= 2: + reason = ' '.join(args[1:]) + else: + reason = '' + if self.current_room().name == 'Info' or not self.current_room().joined: + return + roomname = self.current_room().name + self.muc.eject_user(roomname, 'kick', nick, reason) + + # def command_ban(self, args): + # if len(args) < 1: + # self.command_help(['ban']) + # return + # nick = args[0] + # if len(args) >= 2: + # reason = ' '.join(args[1:]) + # else: + # reason = None + # if self.current_room().name == 'Info' or not self.current_room().joined: + # return + # roomname = self.current_room().name + # self.muc.eject_user(roomname, 'ban', nick, reason) + def command_join(self, args): if len(args) == 0: r = self.current_room() |