[eggheads-patches] PATCH: ctcpmask.patch

Dobos Lorant drummer at sophia.jpte.hu
Mon Oct 11 13:28:42 CST 1999


diff -ur eggdrop1.3.1006/doc/tcl-commands.doc eggdrop1.3/doc/tcl-commands.doc
--- eggdrop1.3.1006/doc/tcl-commands.doc	Tue Oct  6 21:26:10 1998
+++ eggdrop1.3/doc/tcl-commands.doc	Sun Oct 10 21:23:24 1999
@@ -1052,13 +1052,17 @@
        bind ctcp <flags> <keyword> <proc>
        proc-name <nick> <user at host> <handle> <dest> <keyword> <arg...>
 
+       handle of keyword-mask depends on lowercase-ctcp:
+         0: casesensitive compare
+	 1: case insensitive compare
+         2: keyword is handled as a mask (wild_match)
        destination will be a nickname (the bot's nickname, obviously) or
        a channel name; keyword is the ctcp command and arg may be empty;
        if the proc returns 0, the bot will attempt its own processing of
        the ctcp command
 
   (16) CTCR
-       bind ctcr <flags> <keyword-mask> <proc>
+       bind ctcr <flags> <keyword> <proc>
        proc-name <nick> <user at host> <handle> <dest> <keyword> <arg...>
 
        just like ctcp, but this is triggered for a ctcp-reply (ie, ctcp
diff -ur eggdrop1.3.1006/eggdrop.conf.dist eggdrop1.3/eggdrop.conf.dist
--- eggdrop1.3.1006/eggdrop.conf.dist	Tue Oct  6 21:26:10 1998
+++ eggdrop1.3/eggdrop.conf.dist	Sun Oct 10 21:24:59 1999
@@ -651,8 +651,9 @@
 # detect bots that way.
 set quiet-reject 1
 
-# [0/1] answer lower case ctcp's (non rfc compliant)
+# [0/1/2] answer lower case ctcp's (non rfc compliant)
 # mIRC will do this, most other clients will NOT
+# 0: dont answer 1: answer 2: answer, allow wildchars in keyword (for scripts)
 set lowercase-ctcp 0
 
 # answer HOW MANY stacked ctcp's at once
diff -ur eggdrop1.3.1006/src/mod/server.mod/servmsg.c eggdrop1.3/src/mod/server.mod/servmsg.c
--- eggdrop1.3.1006/src/mod/server.mod/servmsg.c	Tue Oct  6 21:26:10 1998
+++ eggdrop1.3/src/mod/server.mod/servmsg.c	Sun Oct 10 21:26:36 1999
@@ -140,6 +140,7 @@
   struct flag_record fr =
   {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
   int x;
+  int flg;
 
   context;
   get_user_flagrec(u, &fr, NULL);
@@ -149,10 +150,14 @@
   Tcl_SetVar(interp, "_ctcpr4", dest, 0);
   Tcl_SetVar(interp, "_ctcpr5", keyword, 0);
   Tcl_SetVar(interp, "_ctcpr6", args, 0);
+  switch (lowercase_ctcp) {
+    case 1: flg = MATCH_CASE;
+    case 2: flg = MATCH_MASK;
+    default: flg = MATCH_EXACT;
+  }
   x = check_tcl_bind(table, keyword, &fr,
 		" $_ctcpr1 $_ctcpr2 $_ctcpr3 $_ctcpr4 $_ctcpr5 $_ctcpr6",
-		     (lowercase_ctcp ? MATCH_EXACT : MATCH_CASE)
-		     | BIND_USE_ATTR | BIND_STACKABLE |
+		     flg | BIND_USE_ATTR | BIND_STACKABLE |
 		     ((table == H_ctcp) ? BIND_WANTRET : 0));
   context;
   return (x == BIND_EXEC_LOG) || (table == H_ctcr);


More information about the Patches mailing list