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 /src/gui | |
parent | 51700ac6902da26847a2c0fd03780e20c6954b1f (diff) | |
download | mana-client-64dad7886e22e24a52c260b5e7de5af1308b9b70.tar.gz mana-client-64dad7886e22e24a52c260b5e7de5af1308b9b70.tar.bz2 mana-client-64dad7886e22e24a52c260b5e7de5af1308b9b70.tar.xz mana-client-64dad7886e22e24a52c260b5e7de5af1308b9b70.zip |
Tweaked /whisper command to allow quoting of nicks with spaces in them.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chat.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
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); |