summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Friis <peavey@placid.dk>2008-04-14 09:51:05 +0000
committerDennis Friis <peavey@placid.dk>2008-04-14 09:51:05 +0000
commit64dad7886e22e24a52c260b5e7de5af1308b9b70 (patch)
treee656d3e7a9f41ee1745f284fd5687cfedfadcd25
parent51700ac6902da26847a2c0fd03780e20c6954b1f (diff)
downloadmana-64dad7886e22e24a52c260b5e7de5af1308b9b70.tar.gz
mana-64dad7886e22e24a52c260b5e7de5af1308b9b70.tar.bz2
mana-64dad7886e22e24a52c260b5e7de5af1308b9b70.tar.xz
mana-64dad7886e22e24a52c260b5e7de5af1308b9b70.zip
Tweaked /whisper command to allow quoting of nicks with spaces in them.
-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);