summaryrefslogtreecommitdiff
path: root/src/gui/widgets/chattab.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-26 09:42:43 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-26 09:42:43 -0600
commit9e4a8ea095a1a0613d7b128f4e29c69643137b07 (patch)
tree82dfb0a17dfc3439554efc77a3d18bf5165cebc3 /src/gui/widgets/chattab.cpp
parentcdcadf6e99a6deaa5b929cdec9736ab1fb280f65 (diff)
downloadmana-client-9e4a8ea095a1a0613d7b128f4e29c69643137b07.tar.gz
mana-client-9e4a8ea095a1a0613d7b128f4e29c69643137b07.tar.bz2
mana-client-9e4a8ea095a1a0613d7b128f4e29c69643137b07.tar.xz
mana-client-9e4a8ea095a1a0613d7b128f4e29c69643137b07.zip
Add ChannelTab for chat channels
This fixes TMWServ compilation form the previous commit.
Diffstat (limited to 'src/gui/widgets/chattab.cpp')
-rw-r--r--src/gui/widgets/chattab.cpp38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 746518ad..ff856361 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -211,6 +211,11 @@ void ChatTab::chatLog(std::string line, int own, bool ignoreRecord)
chatWindow->mRecorder->record(line.substr(3));
}
+void ChatTab::chatLog(std::string &nick, std::string &msg)
+{
+ chatLog(nick + ": " + msg, nick == player_node->getName() ? BY_PLAYER : BY_OTHER, false);
+}
+
void ChatTab::chatSend(std::string &msg)
{
trim(msg);
@@ -273,23 +278,7 @@ void ChatTab::chatSend(std::string &msg)
// Prepare ordinary message
if (msg[0] != '/')
{
-#ifdef TMWSERV_SUPPORT
- Net::GameServer::Player::say(msg);
- /*Channel *channel = channelManager->findByName(getFocused());
- if (channel)
- {
- Net::ChatServer::chat(channel->getId(), msg);
- }*/
-#else
- msg = player_node->getName() + " : " + msg;
-
- MessageOut outMsg(chatWindow->mNetwork);
- outMsg.writeInt16(CMSG_CHAT_MESSAGE);
- // Added + 1 in order to let eAthena parse admin commands correctly
- outMsg.writeInt16(msg.length() + 4 + 1);
- outMsg.writeString(msg, msg.length() + 1);
- return;
-#endif
+ sendChat(msg);
}
else
{
@@ -310,3 +299,18 @@ void ChatTab::clearText()
{
mTextOutput->clearRows();
}
+
+void ChatTab::sendChat(std::string &msg) {
+#ifdef TMWSERV_SUPPORT
+ Net::GameServer::Player::say(msg);
+#else
+ msg = player_node->getName() + " : " + msg;
+
+ MessageOut outMsg(chatWindow->mNetwork);
+ outMsg.writeInt16(CMSG_CHAT_MESSAGE);
+ // Added + 1 in order to let eAthena parse admin commands correctly
+ outMsg.writeInt16(msg.length() + 4 + 1);
+ outMsg.writeString(msg, msg.length() + 1);
+ return;
+#endif
+}