]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Add a few more hooks (ugly, but newserv has no priority system).
authorChris Porter <redacted>
Wed, 15 Feb 2006 19:01:00 +0000 (19:01 +0000)
committerChris Porter <redacted>
Wed, 15 Feb 2006 19:01:00 +0000 (19:01 +0000)
control/control.h
core/hooks.h
irc/irc.c
server/server.c

index caf521009ec5920951a65474094ddded2081fa11..e9560aec95db9200584807f1f861885af078a89f 100644 (file)
@@ -73,8 +73,8 @@ struct specialsched {
 
 #define NL_MANAGEMENT      0x0001  /* hello, password, userflags, noticeflags */
 #define NL_TRUSTS          0x0002  /* trust stuff... */
-#define NL_KICKS           0x0004  /* KICK command */
-#define NL_KILLS           0x0008  /* KILL command */
+#define NL_KICKKILLS       0x0004  /* KICK/KILL command */
+#define NL_MISC            0x0008  /* misc commands (resync, etc) */
 #define NL_GLINES          0x0010  /* GLINE commands */
 #define NL_HITS            0x0020  /* Where a gline or kill is set automatically by the bot */
 #define NL_CLONING         0x0040  /* Clone detection */
@@ -85,6 +85,5 @@ struct specialsched {
 #define NL_OPERING         0x0800  /* when someone opers */
 #define NL_NOTICES         0x1000  /* turn off to receive privmsgs instead of notices */
 #define NL_ALL_COMMANDS    0x2000  /* every single command sent */
-#define NL_MISC            0x4000  /* misc commands */
 
 #endif  
index 1c256d394b1a3193d898aa590bf832c4079d4900..2c17ac5674cf28f364d94fbf7b974ef6139de25d 100644 (file)
 #define HOOK_IRC_SENDBURSTSERVERS  102
 #define HOOK_IRC_SENDBURSTNICKS    103
 #define HOOK_IRC_SENDBURSTBURSTS   104
+#define HOOK_IRC_PRE_DISCON        105
 
 #define HOOK_SERVER_NEWSERVER      200  /* Argument is number of new server */
 #define HOOK_SERVER_LOSTSERVER     201  /* Argument is number of lost server */
+#define HOOK_SERVER_END_OF_BURST   202
+#define HOOK_SERVER_PRE_LOSTSERVER 203  /* Argument is number of lost server */
 
 #define HOOK_NICK_NEWNICK          300  /* Argument is nick* */
 #define HOOK_NICK_RENAME           301  /* Argument is nick* */
index 8c5e26056b0b3dd2b4b84369865111edc1e1dc27..57964a145a9f5dfd1878db1525856c1b988711af 100644 (file)
--- a/irc/irc.c
+++ b/irc/irc.c
@@ -192,6 +192,7 @@ void irc_disconnected() {
     deleteschedule(NULL,&irc_connect,NULL);
     deleteschedule(NULL,&sendping,NULL);
     scheduleoneshot(time(NULL)+2,&irc_connect,NULL);
+    triggerhook(HOOK_IRC_PRE_DISCON,NULL);
     triggerhook(HOOK_IRC_DISCON,NULL);
   }
 }
index b32ceeac7d020f3a42df4c53c0c35c218298bff5..c5fc0d274fbc28d6ab1f2c3db87fd70a60fbfa87 100644 (file)
@@ -105,6 +105,7 @@ int handleeobmsg(void *source, int cargc, char **argv) {
     /* Send EA */
     irc_send("%s EA",mynumeric->content);  
     Error("server",ERR_INFO,"Acknowledging end of burst");
+    triggerhook(HOOK_SERVER_END_OF_BURST, NULL);
   }
   
   return CMD_OK;
@@ -171,6 +172,9 @@ void deleteserver(int servernum) {
   /* Set state to SQUITting, then trigger hook */
   Error("server",ERR_DEBUG,"Setting link state on %s to LS_SQUIT",serverlist[servernum].name->content);
   serverlist[servernum].linkstate=LS_SQUIT;
+
+  /* Until hooks have priorities we need something like this */
+  triggerhook(HOOK_SERVER_PRE_LOSTSERVER,(void *)servernum);
   triggerhook(HOOK_SERVER_LOSTSERVER,(void *)servernum);
   
   /* Now delete the actual server */