From fc4a12470adde2502f37f22b86f58560e416f3e4 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Wed, 15 Apr 2009 09:12:07 -0600 Subject: Make whisper tabs optional --- src/commandhandler.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/commandhandler.cpp') 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 has spaces in it, enclose it in " "double quotes (\").")); } + else if (args == "msgtab" || args == "whispertab" || args == "wt") + { + tab->chatLog(_("Command: /msgtab ")); + tab->chatLog(_("Command: /whispertab ")); + tab->chatLog(_("Command: /wtab ")); + tab->chatLog(_("This command tries to make a tab for whispers between" + "you and .")); + } else if (args == "op") { tab->chatLog(_("Command: /op ")); @@ -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) -- cgit v1.2.3-60-g2f50