diff --git a/CHANGELOG b/CHANGELOG
index f7b9c685..c17e0257 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@ http://codingteam.net/project/poezio/roadmap
- /unquery command
- default nickname is now $USER
- Server on /join command can be omitted
+- /query command can now take a message in parameters
* Poezio 0.6.1 - 13 Jun 2010
- Enable tracebacks
diff --git a/src/gui.py b/src/gui.py
index 5f6ac2f0..9e4fe8ed 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -80,7 +80,7 @@ class Gui(object):
'set': (self.command_set, _("Usage: /set [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 .")),
'kick': (self.command_kick, _("Usage: /kick [reason]\nKick: Kick the user with the specified nickname. You also can give an optional reason.")),
'topic': (self.command_topic, _("Usage: /topic \nTopic: Change the subject of the room")),
- 'query': (self.command_query, _('Usage: /query \nQuery: Open a private conversation with . This nick has to be present in the room you\'re currently in.')),
+ 'query': (self.command_query, _('Usage: /query [message]\nQuery: Open a private conversation with . This nick has to be present in the room you\'re currently in. If you specified a message after the nickname, it will immediately be sent to this user')),
'nick': (self.command_nick, _("Usage: /nick \nNick: Change your nickname in the current room"))
}
@@ -788,9 +788,9 @@ class Gui(object):
def command_query(self, args):
"""
- /query
+ /query [message]
"""
- if len(args) != 1:
+ if len(args) < 1:
return
nick = args[0]
room = self.current_room()
@@ -798,7 +798,11 @@ class Gui(object):
return
for user in room.users:
if user.nick == nick:
- self.open_private_window(room.name, user.nick)
+ r = self.open_private_window(room.name, user.nick)
+ if room and len(args) > 1:
+ msg = ' '.join(args[1:])
+ self.muc.send_private_message(r.name, msg)
+ self.add_message_to_room(r, msg.decode('utf-8'), None, r.own_nick)
def command_topic(self, args):
"""