summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/gui/chat.cpp19
2 files changed, 20 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c0a1a36f..f451f806 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-14 Dennis Friis <peavey@placid.dk>
+
+ * src/gui/chat.cpp: Tweaked /whisper command to allow quoting of nicks
+ with spaces in them.
+
2008-04-14 Philipp Sehmisch <tmw@crushnet.org>
* src/resources/dye.cpp: Fixed multi-channel dyeing (patch by fate)
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index bbd5cb00..d01e934d 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -301,10 +301,21 @@ ChatWindow::chatSend(const std::string &nick, std::string msg)
std::string recvnick = "";
msg.erase(0, IS_WHISPER_LENGTH + 1);
- const std::string::size_type pos = msg.find(" ");
- if (pos != std::string::npos) {
- recvnick = msg.substr(0, pos);
- msg.erase(0, pos + 1);
+ if (msg.substr(0,1) == "\"")
+ {
+ const std::string::size_type pos = msg.find('"', 1);
+ if (pos != std::string::npos) {
+ recvnick = msg.substr(1, pos - 1);
+ msg.erase(0, pos + 2);
+ }
+ }
+ else
+ {
+ const std::string::size_type pos = msg.find(" ");
+ if (pos != std::string::npos) {
+ recvnick = msg.substr(0, pos);
+ msg.erase(0, pos + 1);
+ }
}
MessageOut outMsg(mNetwork);