]> jfr.im git - solanum.git/commitdiff
Rework remote rehash messages to apply to all server notices during rehash.
authorJilles Tjoelker <redacted>
Sat, 7 Mar 2009 00:27:05 +0000 (01:27 +0100)
committerJilles Tjoelker <redacted>
Sat, 7 Mar 2009 00:27:05 +0000 (01:27 +0100)
Previously various notices such as those applying
to modules were not sent to the remote oper.

include/s_conf.h
include/send.h
src/newconf.c
src/s_conf.c
src/send.c

index 31766467f6760d541e58ee4f7da39d3a25cdf17f..4e734d7939e140be18fdeb59ef724c0a940841d8 100644 (file)
@@ -54,8 +54,6 @@ struct ip_value
 extern FILE *conf_fbfile_in;
 extern char conf_line_in[256];
 
-extern struct Client *remote_rehash_oper_p;
-
 struct ConfItem
 {
        struct ConfItem *next;  /* list node pointer */
index cacdc7a6e6521bbb20d839f6bf93a0716323369c..cc3e0112d88fe244e886f60e15e4e896ad71f034 100644 (file)
@@ -38,6 +38,8 @@ struct monitor;
 /* The nasty global also used in s_serv.c for server bursts */
 extern unsigned long current_serial;
 
+extern struct Client *remote_rehash_oper_p;
+
 extern void send_pop_queue(struct Client *);
 
 extern void send_queued(struct Client *to);
index 19d6317c4630e2cd8fe86fe460870a51904f9442..36d05175785f4616b1a4402799440c16a0a51e65 100644 (file)
@@ -1790,8 +1790,6 @@ conf_report_error(const char *fmt, ...)
 
        ierror("\"%s\", line %d: %s", current_file, lineno + 1, msg);
        sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s", current_file, lineno + 1, msg);
-       if (remote_rehash_oper_p)
-               sendto_one_notice(remote_rehash_oper_p, ":*** Notice -- \"%s\", line %d: %s", current_file, lineno + 1, msg);
 }
 
 int
index 718993fccf38516777843f6b3c79e0078b6716c7..fcf83bfa24e5fdcd0bc1e61065ff617b2cf4aee0 100644 (file)
@@ -76,7 +76,6 @@ static void reorganise_temp_kd(void *list);
 
 FILE *conf_fbfile_in;
 extern char yytext[];
-struct Client *remote_rehash_oper_p;
 
 static int verify_access(struct Client *client_p, const char *username);
 static int attach_iline(struct Client *, struct ConfItem *);
@@ -683,10 +682,6 @@ rehash_bans(int sig)
                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                        "Can't open %s file bans could be missing!",
                                        *banconfs[i].filename);
-                       if (remote_rehash_oper_p)
-                               sendto_one_notice(remote_rehash_oper_p,
-                                       ":*** Notice -- Can't open %s file bans could be missing!",
-                                       *banconfs[i].filename);
                }
                else
                {
@@ -1160,9 +1155,6 @@ read_conf_files(int cold)
                {
                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                             "Can't open file '%s' - aborting rehash!", filename);
-                       if (remote_rehash_oper_p)
-                               sendto_one_notice(remote_rehash_oper_p,
-                                            ":*** Notice -- Can't open file '%s' - aborting rehash!", filename);
                        return;
                }
        }
@@ -1533,9 +1525,6 @@ yyerror(const char *msg)
 
        sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s at '%s'",
                             conffilebuf, lineno + 1, msg, newlinebuf);
-       if (remote_rehash_oper_p)
-               sendto_one_notice(remote_rehash_oper_p, ":*** Notice -- \"%s\", line %d: %s at '%s'",
-                                    conffilebuf, lineno + 1, msg, newlinebuf);
 
        ilog(L_MAIN, "\"%s\", line %d: %s at '%s'", conffilebuf, lineno + 1, msg, newlinebuf);
 }
index c0d029d024b03bc89330733fd10b936b269902f4..0da51d36bd9369973e1a4e6fd19f3f5d04ec7b6d 100644 (file)
@@ -49,6 +49,8 @@ static void send_queued_write(rb_fde_t *F, void *data);
 
 unsigned long current_serial = 0L;
 
+struct Client *remote_rehash_oper_p;
+
 /* send_linebuf()
  *
  * inputs      - client to send to, linebuf to attach
@@ -969,6 +971,16 @@ sendto_realops_snomask(int flags, int level, const char *pattern, ...)
                                        ":%s ENCAP * SNOTE %c :%s",
                                        me.id, snobuf[1], buf);
        }
+       else if (remote_rehash_oper_p != NULL)
+       {
+               /* rather a lot of copying around, oh well -- jilles */
+               va_start(args, pattern);
+               rb_vsnprintf(buf, sizeof(buf), pattern, args);
+               va_end(args);
+               rb_linebuf_putmsg(&linebuf, pattern, NULL, 
+                               ":%s NOTICE * :*** Notice -- %s", me.name, buf);
+               sendto_one_notice(remote_rehash_oper_p, ":*** Notice -- %s", buf);
+       }
        else
        {
                va_start(args, pattern);