diff options
author | Dennis Friis <peavey@placid.dk> | 2008-04-14 09:51:05 +0000 |
---|---|---|
committer | Dennis Friis <peavey@placid.dk> | 2008-04-14 09:51:05 +0000 |
commit | 64dad7886e22e24a52c260b5e7de5af1308b9b70 (patch) | |
tree | e656d3e7a9f41ee1745f284fd5687cfedfadcd25 | |
parent | 51700ac6902da26847a2c0fd03780e20c6954b1f (diff) | |
download | Mana-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-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/gui/chat.cpp | 19 |
2 files changed, 20 insertions, 4 deletions
@@ -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); |