diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-03-19 03:37:34 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-03-19 03:37:34 +0000 |
commit | 42fbbddbd4e751e7d13c76cff46b1bc66fc790d9 (patch) | |
tree | 77756f790d5fe44b8737169de19745db4eaa78ed /src | |
parent | a923d32ee47fab1aa5de01a1c41a8082c108a649 (diff) | |
download | poezio-42fbbddbd4e751e7d13c76cff46b1bc66fc790d9.tar.gz poezio-42fbbddbd4e751e7d13c76cff46b1bc66fc790d9.tar.bz2 poezio-42fbbddbd4e751e7d13c76cff46b1bc66fc790d9.tar.xz poezio-42fbbddbd4e751e7d13c76cff46b1bc66fc790d9.zip |
fixed #1228 (/topic command)
Diffstat (limited to 'src')
-rw-r--r-- | src/gui.py | 8 | ||||
-rw-r--r-- | src/room.py | 2 |
2 files changed, 9 insertions, 1 deletions
@@ -81,6 +81,7 @@ class Gui(object): '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 /join. Type /help join 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 blabla`. You can also set an empty value (nothing) by providing no [value] after <option>.')), 'kick': (self.command_kick, _('Usage: /kick <nick> [reason]\nKick: Kick the user with the specified nickname. You also can give an optional reason.')), + 'topic': (self.command_topic, _('Usage: /topic <subject>\nTopic: Change the subject of the room')), 'nick': (self.command_nick, _('Usage: /nick <nickname>\nNick: Change your nickname in the current room')) } @@ -543,6 +544,13 @@ class Gui(object): self.rooms.remove(self.current_room()) self.window.refresh(self.rooms) + def command_topic(self, args): + subject = ' '.join(args) + room = self.current_room() + if not room.joined or room.name == "Info": + return + self.muc.change_subject(room.name, subject) + def command_nick(self, args): if len(args) != 1: return diff --git a/src/room.py b/src/room.py index 0c3a5deb..87a78107 100644 --- a/src/room.py +++ b/src/room.py @@ -39,7 +39,7 @@ class Room(object): self.joined = False self.users = [] - def add_message(self, nick, msg, date=None, delayed=False): + def add_message(self, nick, msg, date=None): if not date: date = datetime.now() color = None |