Commits

Anonymous committed f069ea7

Rework remote rehash messages to apply to all server notices during rehash.
Previously various notices such as those applying
to modules were not sent to the remote oper.

  • Participants
  • Parent commits c0a26a1

Comments (0)

Files changed (5)

File include/s_conf.h

 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 */

File include/send.h

 /* 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);

File src/newconf.c

 
 	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

File src/s_conf.c

 
 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 *);
 			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
 		{
 		{
 			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;
 		}
 	}
 
 	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);
 }
 
 unsigned long current_serial = 0L;
 
+struct Client *remote_rehash_oper_p;
+
 /* send_linebuf()
  *
  * inputs	- client to send to, linebuf to attach
 					":%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);