summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/chatwindow.cpp1
-rw-r--r--src/net/chathandler.h2
-rw-r--r--src/net/eathena/chathandler.cpp9
-rw-r--r--src/net/eathena/chathandler.h2
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/tmwa/chathandler.cpp4
-rw-r--r--src/net/tmwa/chathandler.h2
7 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 69e8c0907..dae1c86b2 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -549,6 +549,7 @@ void ChatWindow::removeChannel(const std::string &name)
std::string tempName = name;
toLower(tempName);
mChannels.erase(tempName);
+ chatHandler->partChannel(name);
}
void ChatWindow::removeAllWhispers()
diff --git a/src/net/chathandler.h b/src/net/chathandler.h
index 770f27e91..bffd897c1 100644
--- a/src/net/chathandler.h
+++ b/src/net/chathandler.h
@@ -58,6 +58,8 @@ class ChatHandler notfinal
virtual void joinChannel(const std::string &channel) = 0;
+ virtual void partChannel(const std::string &channel) = 0;
+
virtual void who() const = 0;
virtual void sendRaw(const std::string &args) const = 0;
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 4c3340836..37f63fbcb 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -646,4 +646,13 @@ void ChatHandler::processJoinChannel(Net::MessageIn &msg)
}
}
+void ChatHandler::partChannel(const std::string &channel)
+{
+ if (serverFeatures->haveJoinChannel())
+ {
+ createOutPacket(CMSG_CHAT_PART_CHANNEL);
+ outMsg.writeString(channel, 24, "channel name");
+ }
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h
index f3893521e..1d2b03e73 100644
--- a/src/net/eathena/chathandler.h
+++ b/src/net/eathena/chathandler.h
@@ -82,6 +82,8 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler
void joinChat(const ChatObject *const chat,
const std::string &password) const override final;
+ void partChannel(const std::string &channel) override final;
+
protected:
static std::string extractChannelFromMessage(std::string &chatMsg);
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 7834b3c14..d8212d647 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -349,6 +349,7 @@
#define CMSG_CHAT_WHO 0x00c1
#define CMSG_CHAT_JOIN 0x00d9
#define CMSG_CHAT_JOIN_CHANNEL 0x0b07
+#define CMSG_CHAT_PART_CHANNEL 0x0b09
#define CMSG_BATTLE_CHAT_MESSAGE 0x02db
#define CMSG_CREAYE_CHAT_ROOM 0x00d5
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index c55089cbc..cb64db0e9 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -466,4 +466,8 @@ void ChatHandler::joinChannel(const std::string &channel A_UNUSED)
{
}
+void ChatHandler::partChannel(const std::string &channel A_UNUSED)
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h
index 80effa23e..9b84987fb 100644
--- a/src/net/tmwa/chathandler.h
+++ b/src/net/tmwa/chathandler.h
@@ -80,6 +80,8 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler
void joinChat(const ChatObject *const chat,
const std::string &password) const override final;
+ void partChannel(const std::string &channel) override final;
+
protected:
static void processChat(Net::MessageIn &msg);