]>
jfr.im git - irc/evilnet/mod.chanfix.git/blob - CHECKCommand.cc
4 * 07/19/2005 - Reed Loden <reed@reedloden.com>
7 * Shows the number of ops and total clients in <channel>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
27 #include "gnuworld_config.h"
31 #include "responses.h"
32 #include "StringTokenizer.h"
41 void CHECKCommand::Exec(iClient
* theClient
, sqlcfUser
* theUser
, const std::string
& Message
)
43 StringTokenizer
st(Message
);
45 Channel
* netChan
= Network
->findChannel(st
[1]);
47 bot
->SendTo(theClient
,
48 bot
->getResponse(theUser
,
49 language::no_such_channel
,
50 std::string("No such channel %s.")).c_str());
54 /* Reports ops and total clients. */
56 bot
->SendTo(theClient
,
57 bot
->getResponse(theUser
,
58 language::check_results
,
59 std::string("I see %d opped out of %d total clients in %s.")).c_str(),
60 bot
->countChanOps(netChan
), netChan
->size(),
61 netChan
->getName().c_str());
63 bot
->logAdminMessage("%s (%s) CHECK %s",
64 theUser
? theUser
->getUserName().c_str() : "!NOT-LOGGED-IN!",
65 theClient
->getRealNickUserHost().c_str(),
66 netChan
->getName().c_str());
68 bot
->logLastComMessage(theClient
, Message
);
74 } // namespace gnuworld