diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-02-08 16:20:39 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-02-08 16:20:39 -0700 |
commit | 308302f858d24d2cc1b1601b100324e2baa50765 (patch) | |
tree | bf76a3e5feb37fc700dbb2738f3b8c1c0f0fc655 /src/commandhandler.cpp | |
parent | a4007a7f8f253e90bb189cfb22b3e0c798440bdc (diff) | |
download | mana-308302f858d24d2cc1b1601b100324e2baa50765.tar.gz mana-308302f858d24d2cc1b1601b100324e2baa50765.tar.bz2 mana-308302f858d24d2cc1b1601b100324e2baa50765.tar.xz mana-308302f858d24d2cc1b1601b100324e2baa50765.zip |
Move party creation command from eA's PartyTab to CommandHandler
Also fix party invite by name when you aren't in a party.
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 != "") |