Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Sun, 16 Apr 2000 05:19:02 +0000 (05:19 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Sun, 16 Apr 2000 05:19:02 +0000 (05:19 +0000)
Log message:

Support dropping the target argument to indicate local JUPEs

(ok, I'll stop now; good night)

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@184 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/m_gline.c
ircd/m_jupe.c

index 074c5ca2d1636eaac8c84750f028fbc326e89405..c87c1cea6519b44d5df7cf4c53afdd56afa90115 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-04-16  Kevin L. Mitchell  <klmitch@mit.edu>
 
+       * ircd/m_jupe.c (mo_jupe): allow target argument to be dropped if
+       this is a local JUPE
+
        * ircd/gline.c: add flags argument to gline_activate and
        gline_deactivate for future expansion
 
 #
 # ChangeLog for ircu2.10.11
 #
-# $Id: ChangeLog,v 1.91 2000-04-16 05:12:01 kev Exp $
+# $Id: ChangeLog,v 1.92 2000-04-16 05:19:02 kev Exp $
 #
 # Insert new changes at beginning of the change list.
 #
index 6c5251667f379a3030bb60d4d22d7494387a1c68..7d82b5ab7c897c8115f4c36bdfd4dc5e6f9a64bb 100644 (file)
@@ -198,12 +198,12 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
  * parv[0] = Sender prefix
  * parv[1] = [[+|-]<G-line mask>]
  *
- * Old style:
+ * Local (to me) style:
  *
  * parv[2] = [Expiration offset]
  * parv[3] = [Comment]
  *
- * New style:
+ * Global (or remote local) style:
  *
  * parv[2] = [target]
  * parv[3] = [Expiration offset]
index 3dbfba51bcd6772671d131e06433e8d91bd0a5df..caafef32755dddbff4d4a52da6b70c1802b284d3 100644 (file)
@@ -178,10 +178,15 @@ int ms_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
  * mo_jupe - oper message handler
  *
  * parv[0] = Send prefix
+ * parv[1] = [[+|-]<server name>]
  *
- * From oper:
+ * Local (to me) style:
+ *
+ * parv[2] = [Expiration offset]
+ * parv[3] = [Comment]
+ *
+ * Global (or remote local) style:
  *
- * parv[1] = [[+|-]<server name>]
  * parv[2] = [target]
  * parv[3] = [Expiration offset]
  * parv[4] = [Comment]
@@ -194,7 +199,7 @@ int mo_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   struct Jupe *ajupe;
   unsigned int flags = 0;
   time_t expire_off;
-  char *server = parv[1], *target = parv[2], *reason = parv[4];
+  char *server = parv[1], *target = 0, *reason;
 
   if (parc < 2)
     return jupe_list(sptr, 0);
@@ -207,28 +212,36 @@ int mo_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   else
     return jupe_list(sptr, server);
 
-  if (parc < 5)
+  if (parc == 4) {
+    expire_off = atoi(parv[2]);
+    reason = parv[3];
+    flags |= JUPE_LOCAL;
+  } else if (parc > 4) {
+    target = parv[2];
+    expire_off = atoi(parv[3]);
+    reason = parv[4];
+  } else
     return need_more_params(sptr, "JUPE");
 
-  if (!(target[0] == '*' && target[1] == '\0')) {
-    if (!(acptr = find_match_server(target)))
-      return send_error_to_client(sptr, ERR_NOSUCHSERVER, target);
+  if (target) {
+    if (!(target[0] == '*' && target[1] == '\0')) {
+      if (!(acptr = find_match_server(target)))
+       return send_error_to_client(sptr, ERR_NOSUCHSERVER, target);
 
-    if (!IsMe(acptr)) { /* manually propagate, since we don't set it */
-      if (!IsOper(sptr))
-       return send_error_to_client(sptr, ERR_NOPRIVILEGES);
+      if (!IsMe(acptr)) { /* manually propagate, since we don't set it */
+       if (!IsOper(sptr))
+         return send_error_to_client(sptr, ERR_NOPRIVILEGES);
 
-      sendcmdto_one(acptr, CMD_JUPE, sptr, "%C %c%s %s %Tu :%s", acptr,
-                   flags & JUPE_ACTIVE ? '+' : '-', server, parv[3],
-                   TStime(), reason);
-      return 0;
-    }
-
-    flags |= JUPE_LOCAL;
-  } else if (!IsOper(sptr))
-    return send_error_to_client(sptr, ERR_NOPRIVILEGES);
+       sendcmdto_one(acptr, CMD_JUPE, sptr, "%C %c%s %s %Tu :%s", acptr,
+                     flags & JUPE_ACTIVE ? '+' : '-', server, parv[3],
+                     TStime(), reason);
+       return 0;
+      }
 
-  expire_off = atoi(parv[3]);
+      flags |= JUPE_LOCAL;
+    } else if (!IsOper(sptr))
+      return send_error_to_client(sptr, ERR_NOPRIVILEGES);
+  }
 
   ajupe = jupe_find(server);