Explorar o código

* cmd_whom now assumes argument '*'

svn: 1705
Bryan Drewery %!s(int64=21) %!d(string=hai) anos
pai
achega
94809d5ac0
Modificáronse 3 ficheiros con 18 adicións e 21 borrados
  1. 1 0
      doc/UPDATES
  2. 2 1
      misc/help.txt
  3. 15 20
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -55,6 +55,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed.
 * '~' replacement is now internal for paths in config.
 * No longer enforcing $binpath/$binname when using -C.
 * $binname is no longer defaulted to ".sshrc"
+* cmd_whom now assumes argument '*'
 
 1.2
 * No longer displaying SALTS on ./bin -v

+ 2 - 1
misc/help.txt

@@ -1759,7 +1759,8 @@ See also: whom
 See also: match, who, whom%{+m|m}, chattr, chaninfo%{-}
 ::whom
 ###  $bwhom$b [channel|*]
-   Displays a list of users on the current partyline channel.
+   Displays a list of users on the botnet.
+   '*' is assumed if no parameters are given.
  
    For example:
       [23:12] #Wcc# whom

+ 15 - 20
src/cmds.c

@@ -189,33 +189,28 @@ static void tell_who(int idx, int chan)
 
 static void cmd_whom(int idx, char *par)
 {
-  if (par[0] == '*') {
-    putlog(LOG_CMDS, "*", "#%s# whom %s", dcc[idx].nick, par);
+  putlog(LOG_CMDS, "*", "#%s# whom %s", dcc[idx].nick, par);
+
+  if (par[0] == '*' || !par[0]) {
+    putlog(LOG_CMDS, "*", "#%s# whom", dcc[idx].nick, par);
     answer_local_whom(idx, -1);
     return;
-  } else if (dcc[idx].u.chat->channel < 0) {
-    dprintf(idx, "You have chat turned off.\n");
-    return;
   }
-  putlog(LOG_CMDS, "*", "#%s# whom %s", dcc[idx].nick, par);
-  if (!par[0]) {
-    answer_local_whom(idx, dcc[idx].u.chat->channel);
-  } else {
-    int chan = -1;
 
-    if ((par[0] < '0') || (par[0] > '9')) {
-      if (chan <= 0) {
-	dprintf(idx, "No such channel exists.\n");
-	return;
-      }
-    } else
-      chan = atoi(par);
-    if ((chan < 0) || (chan > 99999)) {
-      dprintf(idx, "Channel number out of range: must be between 0 and 99999.\n");
+  int chan = -1;
+
+  if ((par[0] < '0') || (par[0] > '9')) {
+    if (chan <= 0) {
+      dprintf(idx, "No such channel exists.\n");
       return;
     }
-    answer_local_whom(idx, chan);
+  } else
+    chan = atoi(par);
+  if ((chan < 0) || (chan > 99999)) {
+    dprintf(idx, "Channel number out of range: must be between 0 and 99999.\n");
+    return;
   }
+  answer_local_whom(idx, chan);
 }
 
 #ifdef HUB