Display detailed usercounts in !peek (ops/voices/regulars)
authorThiefMaster <thiefmaster@gamesurge.net>
Sun, 23 Aug 2009 17:29:25 +0000 (19:29 +0200)
committerMichael Poole <mdpoole@troilus.org>
Mon, 15 Feb 2010 20:57:59 +0000 (15:57 -0500)
languages/de/strings.db
src/chanserv.c

index c92eec1df05efbeb3487eaacb381446ba7b4da65..ee339ee2c421a4ada2d5029a24896ffe145d56b1 100644 (file)
 "CSMSG_PEEK_NO_OPS" "$bOps:            $bkeine";
 "CSMSG_PEEK_OPS" "$bOps:$b";
 "CSMSG_PEEK_TOPIC" "$bTopic:          $b%s";
-"CSMSG_PEEK_USERS" "$bUser Anzahl:    $b%d";
+"CSMSG_PEEK_USERS" "$bUser Anzahl:    $b%d (%d Ops, %d Voices, %d normale)";
 "CSMSG_PING_RESPONSE" "Pong!";
 "CSMSG_PROCESS_FAILED" "$b$C$b konnte die angegebenen Nicknamen nicht finden.";
 "CSMSG_PROTECT_ALL" "Channel Besucher und User, die Access im Channel haben, werden vor Usern mit gleichem oder weniger Access geschützt.";
index b51f916b9bbd07eaf995cce69d0fe9b4f03fba66..e0ec5200d9a980cce6b453ee1ec062b25f48a85e 100644 (file)
@@ -404,7 +404,7 @@ static const struct message_entry msgtab[] = {
     { "CSMSG_PEEK_INFO", "$b%s$b Status:" },
     { "CSMSG_PEEK_TOPIC", "$bTopic:          $b%s" },
     { "CSMSG_PEEK_MODES", "$bModes:          $b%s" },
-    { "CSMSG_PEEK_USERS", "$bTotal users:    $b%d" },
+    { "CSMSG_PEEK_USERS", "$bTotal users:    $b%d (%d ops, %d voices, %d regulars)" },
     { "CSMSG_PEEK_OPS", "$bOps:$b" },
     { "CSMSG_PEEK_NO_OPS", "$bOps:            $bNone present" },
 
@@ -4509,13 +4509,13 @@ static CHANSERV_FUNC(cmd_peek)
     char modes[MODELEN];
     unsigned int n;
     struct helpfile_table table;
+    int opcount = 0, voicecount = 0, srvcount = 0;
 
     irc_make_chanmode(channel, modes);
 
     reply("CSMSG_PEEK_INFO", channel->name);
     reply("CSMSG_PEEK_TOPIC", channel->topic);
     reply("CSMSG_PEEK_MODES", modes);
-    reply("CSMSG_PEEK_USERS", channel->members.used);
 
     table.length = 0;
     table.width = 1;
@@ -4524,12 +4524,23 @@ static CHANSERV_FUNC(cmd_peek)
     for(n = 0; n < channel->members.used; n++)
     {
         mn = channel->members.list[n];
+        if(IsLocal(mn->user))
+            srvcount++;
+        else if(mn->modes & MODE_CHANOP)
+            opcount++;
+        else if(mn->modes & MODE_VOICE)
+            voicecount++;
+
         if(!(mn->modes & MODE_CHANOP) || IsLocal(mn->user))
             continue;
         table.contents[table.length] = alloca(sizeof(**table.contents));
         table.contents[table.length][0] = mn->user->nick;
         table.length++;
     }
+
+    reply("CSMSG_PEEK_USERS", channel->members.used, opcount, voicecount,
+          (channel->members.used - opcount - voicecount - srvcount));
+
     if(table.length)
     {
         reply("CSMSG_PEEK_OPS");