summaryrefslogtreecommitdiff
path: root/src/net/tmwa/chathandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-05-09 18:21:14 -0600
committerJared Adams <jaxad0127@gmail.com>2010-06-29 15:48:52 -0600
commitf1cab9c5ab1d36586ae1e0d1dae3f3d1483522b5 (patch)
treea0146a49c90bd15bb65e8bbae94883b189037a40 /src/net/tmwa/chathandler.cpp
parenta2bb244ea72fefdb60d8ef5b037dfbc5b6ac842d (diff)
downloadMana-f1cab9c5ab1d36586ae1e0d1dae3f3d1483522b5.tar.gz
Mana-f1cab9c5ab1d36586ae1e0d1dae3f3d1483522b5.tar.bz2
Mana-f1cab9c5ab1d36586ae1e0d1dae3f3d1483522b5.tar.xz
Mana-f1cab9c5ab1d36586ae1e0d1dae3f3d1483522b5.zip
Make whisper responses from tmwAthena show up in correct tabs
Reviewed-by: Bertram
Diffstat (limited to 'src/net/tmwa/chathandler.cpp')
-rw-r--r--src/net/tmwa/chathandler.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 493df0e5..53af2e6b 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -70,19 +70,28 @@ void ChatHandler::handleMessage(Net::MessageIn &msg)
switch (msg.getId())
{
case SMSG_WHISPER_RESPONSE:
+ if (mSentWhispers.empty())
+ nick = "user";
+ else
+ {
+ nick = mSentWhispers.front();
+ mSentWhispers.pop();
+ }
+
switch (msg.readInt8())
{
case 0x00:
- // comment out since we'll local echo in chat.cpp instead, then only report failures
- //localChatTab->chatLog("Whisper sent", BY_SERVER);
+ // Success (don't need to report)
break;
case 0x01:
- localChatTab->chatLog(_("Whisper could not be sent, user "
- "is offline."), BY_SERVER);
+ chatWindow->whisper(nick, strprintf(_("Whisper could not "
+ "be sent, %s is offline."), nick.c_str()),
+ BY_SERVER);
break;
case 0x02:
- localChatTab->chatLog(_("Whisper could not be sent, "
- "ignored by user."), BY_SERVER);
+ chatWindow->whisper(nick, strprintf(_("Whisper could not "
+ "be sent, ignored by %s."), nick.c_str()),
+ BY_SERVER);
break;
}
break;
@@ -197,6 +206,8 @@ void ChatHandler::privateMessage(const std::string &recipient,
outMsg.writeInt16(text.length() + 28);
outMsg.writeString(recipient, 24);
outMsg.writeString(text, text.length());
+
+ mSentWhispers.push(recipient);
}
void ChatHandler::channelList()