浏览代码

* cmd_pls_host now accepts multiple hosts

svn: 821
Bryan Drewery 22 年之前
父节点
当前提交
4b6f5d4cab
共有 3 个文件被更改,包括 10 次插入4 次删除
  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.
 13.Removed 53K from the binary (no more compression functions)
 14.Bots were not recognizing keys set in .chanset.
+15.cmd_pls_host now accepts multiple hosts.
 
 1.1.3
 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
 ::+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
    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
 ::+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]) {
       host = newsplit(&par);
       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);
     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);
 
   if (!par[0]) {
-    dprintf(idx, STR("Usage: +host [handle] <newhostmask>\n"));
+    dprintf(idx, STR("Usage: +host [handle] <newhostmask> [anotherhost] ...\n"));
     return;
   }
 
@@ -3340,6 +3340,11 @@ static void cmd_pls_host(struct userrec *u, int idx, char *par)
   addhost_by_handle(handle, host);
   update_mod(handle, dcc[idx].nick, "+host", host);
   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
   check_this_user(handle, 0, NULL);
 #endif /* LEAF */