summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-04-15 09:12:07 -0600
committerJared Adams <jaxad0127@gmail.com>2009-04-15 09:12:07 -0600
commitfc4a12470adde2502f37f22b86f58560e416f3e4 (patch)
treedb745342789cf54de216a8597f483f3609cebe9b /src/commandhandler.cpp
parent8606e95b5c8a5fadde99a253de91a661454460db (diff)
downloadmana-fc4a12470adde2502f37f22b86f58560e416f3e4.tar.gz
mana-fc4a12470adde2502f37f22b86f58560e416f3e4.tar.bz2
mana-fc4a12470adde2502f37f22b86f58560e416f3e4.tar.xz
mana-fc4a12470adde2502f37f22b86f58560e416f3e4.zip
Make whisper tabs optional
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index 586a62cd..9b8c037b 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -68,6 +68,10 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab)
{
handleMsg(args, tab);
}
+ else if (type == "msgtab" || type == "whispertab" || type == "wt")
+ {
+ handleMsgTab(args, tab);
+ }
else if (type == "join")
{
handleJoin(args, tab);
@@ -145,6 +149,9 @@ void CommandHandler::handleHelp(const std::string &args, ChatTab *tab)
tab->chatLog(_("/msg > Send a private message to a user"));
tab->chatLog(_("/whisper > Alias of msg"));
tab->chatLog(_("/w > Alias of msg"));
+ tab->chatLog(_("/msgtab > Makes a tab for private messages with another user"));
+ tab->chatLog(_("/whispertab > Alias of msgtab"));
+ tab->chatLog(_("/wt > Alias of msgtab"));
tab->chatLog(_("/close > Close the whisper tab (only works in whisper tabs)"));
#ifdef TMWSERV_SUPPORT
@@ -219,6 +226,14 @@ void CommandHandler::handleHelp(const std::string &args, ChatTab *tab)
tab->chatLog(_("If the <nick> has spaces in it, enclose it in "
"double quotes (\")."));
}
+ else if (args == "msgtab" || args == "whispertab" || args == "wt")
+ {
+ tab->chatLog(_("Command: /msgtab <nick>"));
+ tab->chatLog(_("Command: /whispertab <nick>"));
+ tab->chatLog(_("Command: /wtab <nick>"));
+ tab->chatLog(_("This command tries to make a tab for whispers between"
+ "you and <nick>."));
+ }
else if (args == "op")
{
tab->chatLog(_("Command: /op <nick>"));
@@ -353,7 +368,15 @@ void CommandHandler::handleMsg(const std::string &args, ChatTab *tab)
chatWindow->whisper(recvnick, msg, true);
}
else
- tab->chatLog("Cannont send empty whispers!");
+ tab->chatLog(_("Cannont send empty whispers!"), BY_SERVER);
+}
+
+void CommandHandler::handleMsgTab(const std::string &args, ChatTab *tab) {
+ if (chatWindow->addWhisperTab(args))
+ return;
+
+ tab->chatLog(strprintf(_("Cannont create a whisper tab for nick '%s'!"
+ "It either already exists, or is you."), args.c_str()), BY_SERVER);
}
void CommandHandler::handleClear(const std::string &args, ChatTab *tab)