summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index 07184f66..465f572d 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -76,6 +76,10 @@ void CommandHandler::handleCommand(const std::string &command)
{
handleQuit();
}
+ else if (type == "topic")
+ {
+ handleTopic(args);
+ }
else if (type == "admin")
{
Net::GameServer::Player::say("/" + args);
@@ -107,6 +111,7 @@ void CommandHandler::handleHelp()
chatWindow->chatLog("/listusers > Lists the users in the current channel");
chatWindow->chatLog("/channel > Register a new channel");
chatWindow->chatLog("/join > Join an already registered channel");
+ chatWindow->chatLog("/topic > Set the topic of the current channel");
chatWindow->chatLog("/quit > Leave a channel");
chatWindow->chatLog("/admin > Send a command to the server (GM only)");
chatWindow->chatLog("/clear > Clears this window");
@@ -171,6 +176,18 @@ void CommandHandler::handleListUsers()
Net::ChatServer::getUserList(chatWindow->getFocused());
}
+void CommandHandler::handleTopic(const std::string &args)
+{
+ if (Channel *channel = channelManager->findByName(chatWindow->getFocused()))
+ {
+ Net::ChatServer::setChannelTopic(channel->getId(), args);
+ }
+ else
+ {
+ chatWindow->chatLog("Unable to set this channel's topic", BY_CHANNEL);
+ }
+}
+
void CommandHandler::handleQuit()
{
if (Channel *channel = channelManager->findByName(chatWindow->getFocused()))