if (cargc==1) {
/* One arg: list chanlev */
+ int ncnt=0,mcnt=0,ocnt=0,vcnt=0,kcnt=0,bcnt=0;
+
if (cs_privcheck(QPRIV_VIEWFULLCHANLEV, sender)) {
reguser *founder=NULL, *addedby=NULL;
addedby=findreguserbyID(rcp->addedby);
flags=rcuplist->flags & (flagmask | QCUFLAGS_PERSONAL);
}
+ /* Do the count here; note that +n's aren't counted as +m (and so on). We're not
+ * using the IsX() macros because the displayed count needs to match up with
+ * the displayed flags... */
+ if (flags & QCUFLAG_OWNER) ncnt++; else
+ if (flags & QCUFLAG_MASTER) mcnt++; else
+ if (flags & QCUFLAG_OP) ocnt++; else
+ if (flags & QCUFLAG_VOICE) vcnt++; else
+ if (flags & QCUFLAG_KNOWN) kcnt++;
+ if (flags & QCUFLAG_BANNED) bcnt++;
+
if (!donehead) {
chanservstdmessage(sender, QM_CHANLEVHEADER, cip->name->content);
if (showtimes)
if (donehead) {
chanservstdmessage(sender, QM_ENDOFLIST);
+ chanservstdmessage(sender, QM_CHANLEVSUMMARY, j, ncnt, mcnt, ocnt, vcnt, kcnt, bcnt);
} else {
chanservstdmessage(sender, QM_NOUSERSONCHANLEV, cip->name->content);
}
chanservaddcommand("quit", QCMD_DEV, 1, cs_doquit, "Makes the bot QUIT and \"reconnect\".","");
chanservaddcommand("rename", QCMD_DEV, 1, cs_dorename, "Changes the bot's name.","");
chanservaddcommand("rehash", QCMD_DEV, 0, cs_dorehash, "Reloads all text from database.","");
- chanservaddcommand("help", 0, 1, cs_dohelp, "Displays help on a specific command.","Usage: HELP <command>\nShows help for a command, where:\ncommand - the command to show help for.\nFor a list of available commands, see SHOWCOMMANDS.\n");
+ /* Make "HELP" take 2 arguments so things like "HELP chanflags #channel" work. Any junk after the command will go into arg 2 and be ignored. */
+ chanservaddcommand("help", 0, 2, cs_dohelp, "Displays help on a specific command.","Usage: HELP <command>\nShows help for a command, where:\ncommand - the command to show help for.\nFor a list of available commands, see SHOWCOMMANDS.\n");
chanservaddcommand("version", 0, 1, cs_doversion, "Show Version.","Usage: VERSION\nShows the version number of the running bot.");
chanservaddctcpcommand("ping",cs_doctcpping);
#define QM_RESETOK 166
#define QM_BADRESETCODE 167
#define QM_CHALLENGEDDEPRECATED 168
+#define QM_CHANLEVSUMMARY 169
/* List of privileged operations */
/* 166*/ "Your old account settings have been restored, please check your email.",
/* 167*/ "Bad reset code.",
/* 168*/ "WARNING: the selected algorithm is legacy functionality and is likely to be removed in the near future.",
+ /* 169*/ "Total: %d (owner: %d, master: %d, op: %d, voice: %d, known: %d, ban: %d)."
};
void initmessages() {
strftime(buf2,15,"%d/%m/%y %H:%M",tmp);
count++;
- chanservsendmessage(sender, "%-15s %-13s %-15s %-15s %-15s %s", dbrup->username, suspendtype, UHasOperPriv(rup)?(bywhom?bywhom:"unknown"):"not shown", buf2, (dbrup->suspendexp)?((time(0) >= dbrup->suspendexp)?"next auth":buf):"never", dbrup->suspendreason->content);
+ chanservsendmessage(sender, "%-15s %-13s %-15s %-15s %-15s %s", dbrup->username, suspendtype, UHasOperPriv(rup)?(bywhom?bywhom:"unknown"):"not shown", buf2, (dbrup->suspendexp)?((time(0) >= dbrup->suspendexp)?"next auth":buf):"never", dbrup->suspendreason?dbrup->suspendreason->content:"(none)");
if (count >= 2000) {
chanservstdmessage(sender, QM_TOOMANYRESULTS, 2000, "users");
return CMD_ERROR;