Parcourir la source

* cmd_pls_host now accepts multiple hosts

svn: 821
Bryan Drewery il y a 22 ans
Parent
commit
4b6f5d4cab
3 fichiers modifiés avec 10 ajouts et 4 suppressions
  1. 1 0
      doc/UPDATES
  2. 2 2
      misc/help.txt
  3. 7 2
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -15,6 +15,7 @@ This is a summary of ChangeLog basically.
 12.New +take. -ooo with a random +o. All non-bots deopped.
 12.New +take. -ooo with a random +o. All non-bots deopped.
 13.Removed 53K from the binary (no more compression functions)
 13.Removed 53K from the binary (no more compression functions)
 14.Bots were not recognizing keys set in .chanset.
 14.Bots were not recognizing keys set in .chanset.
+15.cmd_pls_host now accepts multiple hosts.
 
 
 1.1.3
 1.1.3
 1.Fixed a very fatal bug with channel ctcps.
 1.Fixed a very fatal bug with channel ctcps.

+ 2 - 2
misc/help.txt

@@ -29,10 +29,10 @@ See also: -chrec, chattr%{+n}, +chan, -chan%{-}
  
  
 See also: exempts, -exempt, stick, unstick
 See also: exempts, -exempt, stick, unstick
 ::+host
 ::+host
-###  %b+host%b [handle] <hostmask>
+###  %b+host%b [handle] <hostmask> [anotherhost] ...
    Adds a hostmask to a user's user record. Hostmasks are used to identify your
    Adds a hostmask to a user's user record. Hostmasks are used to identify your
    handle on IRC. If a handle is not specified, the hostmask will be added to
    handle on IRC. If a handle is not specified, the hostmask will be added to
-   YOUR user record.
+   YOUR user record. List as many hosts as wanted.
  
  
 See also: -host
 See also: -host
 ::+ignore
 ::+ignore

+ 7 - 2
src/cmds.c

@@ -3192,7 +3192,7 @@ static void cmd_pls_user(struct userrec *u, int idx, char *par)
     while (par[0]) {
     while (par[0]) {
       host = newsplit(&par);
       host = newsplit(&par);
       set_user(&USERENTRY_HOSTS, u2, host);
       set_user(&USERENTRY_HOSTS, u2, host);
-      dprintf(idx, STR("Added host %s to %s.\n"), host, handle);
+      dprintf(idx, STR("Added host '%s' to %s.\n"), host, handle);
     }
     }
     make_rand_str(s, 15);
     make_rand_str(s, 15);
     set_user(&USERENTRY_PASS, u2, s);
     set_user(&USERENTRY_PASS, u2, s);
@@ -3280,7 +3280,7 @@ static void cmd_pls_host(struct userrec *u, int idx, char *par)
   putlog(LOG_CMDS, "*", STR("#%s# +host %s"), dcc[idx].nick, par);
   putlog(LOG_CMDS, "*", STR("#%s# +host %s"), dcc[idx].nick, par);
 
 
   if (!par[0]) {
   if (!par[0]) {
-    dprintf(idx, STR("Usage: +host [handle] <newhostmask>\n"));
+    dprintf(idx, STR("Usage: +host [handle] <newhostmask> [anotherhost] ...\n"));
     return;
     return;
   }
   }
 
 
@@ -3340,6 +3340,11 @@ static void cmd_pls_host(struct userrec *u, int idx, char *par)
   addhost_by_handle(handle, host);
   addhost_by_handle(handle, host);
   update_mod(handle, dcc[idx].nick, "+host", host);
   update_mod(handle, dcc[idx].nick, "+host", host);
   dprintf(idx, STR("Added '%s' to %s.\n"), host, handle);
   dprintf(idx, STR("Added '%s' to %s.\n"), host, handle);
+  while (par[0]) {
+    host = newsplit(&par);
+    addhost_by_handle(handle, host);
+    dprintf(idx, STR("Added host '%s' to %s.\n"), host, handle);
+  }
 #ifdef LEAF
 #ifdef LEAF
   check_this_user(handle, 0, NULL);
   check_this_user(handle, 0, NULL);
 #endif /* LEAF */
 #endif /* LEAF */