diff options
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r-- | src/commandhandler.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 18844d74..3b527a37 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -98,6 +98,10 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab) { handleClear(args, tab); } + else if (type == "createparty") + { + handleCreateParty(args, tab); + } else if (type == "party") { handleParty(args, tab); @@ -170,6 +174,7 @@ void CommandHandler::handleHelp(const std::string &args, ChatTab *tab) tab->chatLog(_("/list > Display all public channels")); tab->chatLog(_("/join > Join or create a channel")); + tab->chatLog(_("/createparty > Create a new party")); tab->chatLog(_("/party > Invite a user to party")); tab->chatLog(_("/record > Start recording the chat to an external file")); @@ -243,6 +248,11 @@ void CommandHandler::handleHelp(const std::string &args, ChatTab *tab) tab->chatLog(_("This command tries to make a tab for whispers between" "you and <nick>.")); } + else if (args == "createparty") + { + tab->chatLog(_("Command: /createparty <name>")); + tab->chatLog(_("This command creates a new party called <name>.")); + } else if (args == "party") { tab->chatLog(_("Command: /party <nick>")); @@ -393,6 +403,18 @@ void CommandHandler::handleListChannels(const std::string &args, ChatTab *tab) Net::getChatHandler()->channelList(); } +void CommandHandler::handleCreateParty(const std::string &args, ChatTab *tab) +{ + if (args.empty()) + { + tab->chatLog(_("Party name is missing."), BY_SERVER); + } + else + { + Net::getPartyHandler()->create(args); + } +} + void CommandHandler::handleParty(const std::string &args, ChatTab *tab) { if (args != "") |