summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2012-10-30 21:04:38 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2012-10-30 21:04:38 +0000
commit363f35dab5293ee89b870df8effd09249d024576 (patch)
tree82fa01195c8cfe635bcef3a28f0b51ebfef0d424 /src
parenteef62fc56ba6df5690830206d5341cbd5be91612 (diff)
- Made m_globops() and ms_globops() use sendto_realops_flags()
- Added message-type parameter to sendto_realops_flags() which can be one of SEND_NOTICE, SEND_GLOBAL, SEND_LOCOPS - Forward-port -r1617 git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1618 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r--src/channel.c10
-rw-r--r--src/channel_mode.c2
-rw-r--r--src/client.c33
-rw-r--r--src/conf.c42
-rw-r--r--src/csvlib.c8
-rw-r--r--src/fdlist.c2
-rw-r--r--src/hostmask.c2
-rw-r--r--src/ircd.c4
-rw-r--r--src/listener.c3
-rw-r--r--src/modules.c13
-rw-r--r--src/numeric.c3
-rw-r--r--src/parse.c34
-rw-r--r--src/s_bsd.c3
-rw-r--r--src/s_serv.c57
-rw-r--r--src/s_user.c26
-rw-r--r--src/send.c66
16 files changed, 161 insertions, 147 deletions
diff --git a/src/channel.c b/src/channel.c
index 14e6a14..90d1548 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -103,7 +103,7 @@ add_user_to_channel(struct Channel *chptr, struct Client *who,
if (!IsSetJoinFloodNoticed(chptr))
{
SetJoinFloodNoticed(chptr);
- sendto_realops_flags(UMODE_BOTS, L_ALL,
+ sendto_realops_flags(UMODE_BOTS, L_ALL, SEND_NOTICE,
"Possible Join Flooder %s on %s target: %s",
get_client_name(who, HIDE_IP),
who->servptr->name, chptr->chname);
@@ -777,12 +777,12 @@ check_spambot_warning(struct Client *source_p, const char *name)
{
/* Its already known as a possible spambot */
if (name != NULL)
- sendto_realops_flags(UMODE_BOTS, L_ALL,
+ sendto_realops_flags(UMODE_BOTS, L_ALL, SEND_NOTICE,
"User %s (%s@%s) trying to join %s is a possible spambot",
source_p->name, source_p->username,
source_p->host, name);
else
- sendto_realops_flags(UMODE_BOTS, L_ALL,
+ sendto_realops_flags(UMODE_BOTS, L_ALL, SEND_NOTICE,
"User %s (%s@%s) is a possible spambot",
source_p->name, source_p->username,
source_p->host);
@@ -833,7 +833,7 @@ check_splitmode(void *unused)
{
splitmode = 1;
- sendto_realops_flags(UMODE_ALL,L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Network split, activating splitmode");
eventAddIsh("check_splitmode", check_splitmode, NULL, 10);
}
@@ -841,7 +841,7 @@ check_splitmode(void *unused)
{
splitmode = 0;
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Network rejoined, deactivating splitmode");
eventDelete(check_splitmode, NULL);
}
diff --git a/src/channel_mode.c b/src/channel_mode.c
index 4751ec4..5607df2 100644
--- a/src/channel_mode.c
+++ b/src/channel_mode.c
@@ -302,7 +302,7 @@ del_id(struct Channel *chptr, char *banid, int type)
list = &chptr->invexlist;
break;
default:
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"del_id() called with unknown ban type %d!", type);
return 0;
}
diff --git a/src/client.c b/src/client.c
index 4341716..2d245ec 100644
--- a/src/client.c
+++ b/src/client.c
@@ -280,10 +280,10 @@ check_pings_list(dlink_list *list)
*/
if (IsServer(client_p) || IsHandshake(client_p))
{
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"No response from %s, closing link",
get_client_name(client_p, HIDE_IP));
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"No response from %s, closing link",
get_client_name(client_p, MASK_IP));
ilog(LOG_TYPE_IRCD, "No response from %s, closing link",
@@ -303,10 +303,10 @@ check_pings_list(dlink_list *list)
* the PING, notify the opers so that they are aware of the problem.
*/
SetPingWarning(client_p);
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"Warning, no response from %s in %d seconds",
get_client_name(client_p, HIDE_IP), pingwarn);
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"Warning, no response from %s in %d seconds",
get_client_name(client_p, MASK_IP), pingwarn);
ilog(LOG_TYPE_IRCD, "No response from %s in %d seconds",
@@ -382,7 +382,7 @@ check_conf_klines(void)
if (IsExemptKline(client_p) ||
IsExemptGline(client_p))
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"GLINE over-ruled for %s, client is %sline_exempt",
get_client_name(client_p, HIDE_IP), IsExemptKline(client_p) ? "k" : "g");
continue;
@@ -400,7 +400,7 @@ check_conf_klines(void)
/* if there is a returned struct AccessItem.. then kill it */
if (IsExemptKline(client_p))
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"KLINE over-ruled for %s, client is kline_exempt",
get_client_name(client_p, HIDE_IP));
continue;
@@ -489,7 +489,7 @@ ban_them(struct Client *client_p, struct ConfItem *conf)
if (xconf != NULL)
user_reason = xconf->reason ? xconf->reason : type_string;
- sendto_realops_flags(UMODE_ALL, L_ALL, "%s active for %s",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s active for %s",
type_string, get_client_name(client_p, HIDE_IP));
if (IsClient(client_p))
@@ -518,7 +518,8 @@ update_client_exit_stats(struct Client *client_p)
--Count.invisi;
}
else if (IsServer(client_p))
- sendto_realops_flags(UMODE_EXTERNAL, L_ALL, "Server %s split from %s",
+ sendto_realops_flags(UMODE_EXTERNAL, L_ALL, SEND_NOTICE,
+ "Server %s split from %s",
client_p->name, client_p->servptr->name);
if (splitchecking && !splitmode)
@@ -896,11 +897,13 @@ exit_client(struct Client *source_p, struct Client *from, const char *comment)
free_list_task(source_p->localClient->list_task, source_p);
watch_del_watch_list(source_p);
- sendto_realops_flags(UMODE_CCONN, L_ALL, "Client exiting: %s (%s@%s) [%s] [%s]",
+ sendto_realops_flags(UMODE_CCONN, L_ALL, SEND_NOTICE,
+ "Client exiting: %s (%s@%s) [%s] [%s]",
source_p->name, source_p->username, source_p->host, comment,
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
"255.255.255.255" : source_p->sockhost);
- sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, "CLIEXIT: %s %s %s %s 0 %s",
+ sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, SEND_NOTICE,
+ "CLIEXIT: %s %s %s %s 0 %s",
source_p->name,
source_p->username,
source_p->host,
@@ -972,7 +975,7 @@ exit_client(struct Client *source_p, struct Client *from, const char *comment)
if (source_p->servptr == &me)
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"%s was connected for %d seconds. %llu/%llu sendK/recvK.",
source_p->name, (int)(CurrentTime - source_p->localClient->firsttime),
source_p->localClient->send.bytes >> 10,
@@ -1051,12 +1054,12 @@ dead_link_on_read(struct Client *client_p, int error)
if (error == 0)
{
/* Admins get the real IP */
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"Server %s closed the connection",
get_client_name(client_p, SHOW_IP));
/* Opers get a masked IP */
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"Server %s closed the connection",
get_client_name(client_p, MASK_IP));
@@ -1071,7 +1074,7 @@ dead_link_on_read(struct Client *client_p, int error)
get_client_name(client_p, MASK_IP), current_error);
}
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"%s had been connected for %d day%s, %2d:%02d:%02d",
client_p->name, connected/86400,
(connected/86400 == 1) ? "" : "s",
@@ -1103,7 +1106,7 @@ exit_aborted_clients(void)
if (target_p == NULL)
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Warning: null client on abort_list!");
dlinkDelete(ptr, &abort_list);
free_dlink_node(ptr);
diff --git a/src/conf.c b/src/conf.c
index b5adf94..98109d8 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -760,7 +760,7 @@ check_client(va_list args)
switch (i)
{
case TOO_MANY:
- sendto_realops_flags(UMODE_FULL, L_ALL,
+ sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE,
"Too many on IP for %s (%s).",
get_client_name(source_p, SHOW_IP),
source_p->sockhost);
@@ -771,8 +771,8 @@ check_client(va_list args)
break;
case I_LINE_FULL:
- sendto_realops_flags(UMODE_FULL, L_ALL,
- "I-line is full for %s (%s).",
+ sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE,
+ "auth{} block is full for %s (%s).",
get_client_name(source_p, SHOW_IP),
source_p->sockhost);
ilog(LOG_TYPE_IRCD, "Too many connections from %s.",
@@ -786,7 +786,7 @@ check_client(va_list args)
++ServerStats.is_ref;
/* jdc - lists server name & port connections are on */
/* a purely cosmetical change */
- sendto_realops_flags(UMODE_UNAUTH, L_ALL,
+ sendto_realops_flags(UMODE_UNAUTH, L_ALL, SEND_NOTICE,
"Unauthorized client connection from %s [%s] on [%s/%u].",
get_client_name(source_p, SHOW_IP),
source_p->sockhost,
@@ -875,7 +875,8 @@ verify_access(struct Client *client_p, const char *username)
conf = unmap_conf_item(aconf);
if (!ConfigFileEntry.hide_spoof_ips && IsConfSpoofNotice(aconf))
- sendto_realops_flags(UMODE_ALL, L_ADMIN, "%s spoofing: %s as %s",
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
+ "%s spoofing: %s as %s",
client_p->name, client_p->host, conf->name);
strlcpy(client_p->host, conf->name, sizeof(client_p->host));
SetIPSpoof(client_p);
@@ -1685,7 +1686,7 @@ int
rehash(int sig)
{
if (sig != 0)
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Got signal SIGHUP, reloading ircd.conf file");
restart_resolver();
@@ -2077,8 +2078,8 @@ expire_tklines(dlink_list *tklist)
if (xconf->hold <= CurrentTime)
{
if (ConfigFileEntry.tkline_expire_notices)
- sendto_realops_flags(UMODE_ALL, L_ALL,
- "Temporary X-line for [%s] sexpired", conf->name);
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Temporary X-line for [%s] expired", conf->name);
dlinkDelete(ptr, tklist);
free_dlink_node(ptr);
delete_conf_item(conf);
@@ -2090,7 +2091,7 @@ expire_tklines(dlink_list *tklist)
if (nconf->hold <= CurrentTime)
{
if (ConfigFileEntry.tkline_expire_notices)
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Temporary RESV for [%s] expired", conf->name);
dlinkDelete(ptr, tklist);
free_dlink_node(ptr);
@@ -2103,7 +2104,7 @@ expire_tklines(dlink_list *tklist)
if (cconf->hold <= CurrentTime)
{
if (ConfigFileEntry.tkline_expire_notices)
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Temporary RESV for [%s] expired", cconf->name);
delete_channel_resv(cconf);
}
@@ -2231,7 +2232,7 @@ read_conf_files(int cold)
}
else
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Unable to read configuration file '%s': %s",
filename, strerror(errno));
return;
@@ -2294,7 +2295,7 @@ parse_conf_file(int type, int cold)
ilog(LOG_TYPE_IRCD, "Unable to read configuration file '%s': %s",
filename, strerror(errno));
else
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Unable to read configuration file '%s': %s",
filename, strerror(errno));
}
@@ -2775,11 +2776,11 @@ conf_add_class_to_conf(struct ConfItem *conf, const char *class_name)
aconf->class_ptr = class_default;
if (conf->type == CLIENT_TYPE)
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Warning *** Defaulting to default class for %s@%s",
aconf->user, aconf->host);
else
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Warning *** Defaulting to default class for %s",
conf->name);
}
@@ -2792,11 +2793,11 @@ conf_add_class_to_conf(struct ConfItem *conf, const char *class_name)
if (aconf->class_ptr == NULL || !class->active)
{
if (conf->type == CLIENT_TYPE)
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Warning *** Defaulting to default class for %s@%s",
aconf->user, aconf->host);
else
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Warning *** Defaulting to default class for %s",
conf->name);
aconf->class_ptr = class_default;
@@ -2819,14 +2820,16 @@ conf_add_server(struct ConfItem *conf, const char *class_name)
if (!aconf->host || !conf->name)
{
- sendto_realops_flags(UMODE_ALL, L_ALL, "Bad connect block");
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Bad connect block");
ilog(LOG_TYPE_IRCD, "Bad connect block");
return -1;
}
if (EmptyString(aconf->passwd))
{
- sendto_realops_flags(UMODE_ALL, L_ALL, "Bad connect block, name %s",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Bad connect block, name %s",
conf->name);
ilog(LOG_TYPE_IRCD, "Bad connect block, host %s", conf->name);
return -1;
@@ -2852,7 +2855,8 @@ yyerror(const char *msg)
return;
strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf));
- sendto_realops_flags(UMODE_ALL, L_ALL, "\"%s\", line %u: %s: %s",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "\"%s\", line %u: %s: %s",
conffilebuf, lineno + 1, msg, newlinebuf);
ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s",
conffilebuf, lineno + 1, msg, newlinebuf);
diff --git a/src/csvlib.c b/src/csvlib.c
index 0b6034d..cb43243 100644
--- a/src/csvlib.c
+++ b/src/csvlib.c
@@ -244,7 +244,7 @@ write_conf_line(struct Client *source_p, struct ConfItem *conf,
if ((out = fopen(filename, "a")) == NULL)
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"*** Problem opening %s ", filename);
return;
}
@@ -253,7 +253,7 @@ write_conf_line(struct Client *source_p, struct ConfItem *conf,
{
case KLINE_TYPE:
aconf = (struct AccessItem *)map_to_conf(conf);
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"%s added K-Line for [%s@%s] [%s]",
get_oper_name(source_p),
aconf->user, aconf->host, aconf->reason);
@@ -268,7 +268,7 @@ write_conf_line(struct Client *source_p, struct ConfItem *conf,
break;
case DLINE_TYPE:
aconf = (struct AccessItem *)map_to_conf(conf);
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"%s added D-Line for [%s] [%s]",
get_oper_name(source_p), aconf->host, aconf->reason);
sendto_one(source_p, ":%s NOTICE %s :Added D-Line [%s] to %s",
@@ -283,7 +283,7 @@ write_conf_line(struct Client *source_p, struct ConfItem *conf,
case XLINE_TYPE:
xconf = (struct MatchItem *)map_to_conf(conf);
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"%s added X-Line for [%s] [%s]",
get_oper_name(source_p), conf->name,
xconf->reason);
diff --git a/src/fdlist.c b/src/fdlist.c
index 5400ad3..d7729d2 100644
--- a/src/fdlist.c
+++ b/src/fdlist.c
@@ -52,7 +52,7 @@ changing_fdlimit(va_list args)
if (ServerInfo.max_clients > (unsigned int)MAXCLIENTS_MAX)
{
if (old_fdlimit != 0)
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"HARD_FDLIMIT changed to %d, adjusting MAXCLIENTS to %d",
hard_fdlimit, MAXCLIENTS_MAX);
diff --git a/src/hostmask.c b/src/hostmask.c
index f7cca41..368378b 100644
--- a/src/hostmask.c
+++ b/src/hostmask.c
@@ -782,7 +782,7 @@ hostmask_send_expiration(struct AddressRec *arec)
break;
}
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Temporary %c-line for [%s@%s] expired", ban_type,
(arec->aconf->user) ? arec->aconf->user : "*",
(arec->aconf->host) ? arec->aconf->host : "*");
diff --git a/src/ircd.c b/src/ircd.c
index ee02bcd..d7ac4a7 100644
--- a/src/ircd.c
+++ b/src/ircd.c
@@ -174,7 +174,7 @@ set_time(void)
{
ilog(LOG_TYPE_IRCD, "Clock Failure (%s), TS can be corrupted",
strerror(errno));
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Clock Failure (%s), TS can be corrupted",
strerror(errno));
restart("Clock Failure");
@@ -243,7 +243,7 @@ io_loop(void)
if (doremotd)
{
read_message_file(&ConfigFileEntry.motd);
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Got signal SIGUSR1, reloading ircd motd file");
doremotd = 0;
}
diff --git a/src/listener.c b/src/listener.c
index 3572570..326ba43 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -384,7 +384,8 @@ accept_connection(fde_t *pfd, void *data)
*/
if ((last_oper_notice + 20) <= CurrentTime)
{
- sendto_realops_flags(UMODE_ALL, L_ALL, "All connections in use. (%s)",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "All connections in use. (%s)",
get_listener_name(listener));
last_oper_notice = CurrentTime;
}
diff --git a/src/modules.c b/src/modules.c
index 8a5ab1b..677eb82 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -97,7 +97,8 @@ unload_one_module(const char *name, int warn)
if (warn == 1)
{
ilog(LOG_TYPE_IRCD, "Module %s unloaded", name);
- sendto_realops_flags(UMODE_ALL, L_ALL, "Module %s unloaded", name);
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Module %s unloaded", name);
}
return 0;
@@ -122,7 +123,8 @@ load_a_module(const char *path, int warn)
if (!(tmpptr = lt_dlopen(path))) {
const char *err = ((err = lt_dlerror())) ? err : "<unknown>";
- sendto_realops_flags(UMODE_ALL, L_ALL, "Error loading module %s: %s",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Error loading module %s: %s",
mod_basename, err);
ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err);
return -1;
@@ -132,7 +134,8 @@ load_a_module(const char *path, int warn)
{
const char *err = ((err = lt_dlerror())) ? err : "<unknown>";
- sendto_realops_flags(UMODE_ALL, L_ALL, "Error loading module %s: %s",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Error loading module %s: %s",
mod_basename, err);
ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err);
lt_dlclose(tmpptr);
@@ -152,7 +155,7 @@ load_a_module(const char *path, int warn)
if (warn == 1)
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Module %s [version: %s handle: %p] loaded.",
modp->name, modp->version, tmpptr);
ilog(LOG_TYPE_IRCD, "Module %s [version: %s handle: %p] loaded.",
@@ -394,7 +397,7 @@ load_one_module(const char *path)
return load_a_module(modpath, 1);
}
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Cannot locate module %s", path);
ilog(LOG_TYPE_IRCD, "Cannot locate module %s", path);
return -1;
diff --git a/src/numeric.c b/src/numeric.c
index 2a1042d..4da0786 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -213,7 +213,8 @@ set_locale(const char *locale)
strlcpy(used_locale, locale, sizeof(used_locale));
if (!res)
- sendto_realops_flags(UMODE_ALL, L_ADMIN, "Language file [%s] contains "
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
+ "Language file [%s] contains "
"errors, check server log file for more details",
used_locale);
}
diff --git a/src/parse.c b/src/parse.c
index f326d74..b79a2f8 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -322,7 +322,7 @@ handle_command(struct Message *mptr, struct Client *client_p,
}
else
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Dropping server %s due to (invalid) command '%s' "
"with only %d arguments (expecting %d).",
client_p->name, mptr->cmd, i, mptr->args_min);
@@ -572,13 +572,15 @@ cancel_clients(struct Client *client_p, struct Client *source_p, char *cmd)
*/
if (IsServer(source_p) || IsMe(source_p))
{
- sendto_realops_flags(UMODE_DEBUG, L_ADMIN, "Message for %s[%s] from %s",
+ sendto_realops_flags(UMODE_DEBUG, L_ADMIN, SEND_NOTICE,
+ "Message for %s[%s] from %s",
source_p->name, source_p->from->name,
get_client_name(client_p, SHOW_IP));
- sendto_realops_flags(UMODE_DEBUG, L_OPER, "Message for %s[%s] from %s",
+ sendto_realops_flags(UMODE_DEBUG, L_OPER, SEND_NOTICE,
+ "Message for %s[%s] from %s",
source_p->name, source_p->from->name,
get_client_name(client_p, MASK_IP));
- sendto_realops_flags(UMODE_DEBUG, L_ALL,
+ sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
"Not dropping server %s (%s) for Fake Direction",
client_p->name, source_p->name);
return -1;
@@ -594,11 +596,11 @@ cancel_clients(struct Client *client_p, struct Client *source_p, char *cmd)
*
* all servers must be TS these days --is
*/
- sendto_realops_flags(UMODE_DEBUG, L_ADMIN,
+ sendto_realops_flags(UMODE_DEBUG, L_ADMIN, SEND_NOTICE,
"Message for %s[%s@%s!%s] from %s (TS, ignored)",
source_p->name, source_p->username, source_p->host,
source_p->from->name, get_client_name(client_p, SHOW_IP));
- sendto_realops_flags(UMODE_DEBUG, L_OPER,
+ sendto_realops_flags(UMODE_DEBUG, L_OPER, SEND_NOTICE,
"Message for %s[%s@%s!%s] from %s (TS, ignored)",
source_p->name, source_p->username, source_p->host,
source_p->from->name, get_client_name(client_p, MASK_IP));
@@ -626,10 +628,10 @@ remove_unknown(struct Client *client_p, char *lsender, char *lbuffer)
if ((IsDigit(*lsender) && strlen(lsender) <= IRC_MAXSID) ||
strchr(lsender, '.') != NULL)
{
- sendto_realops_flags(UMODE_DEBUG, L_ADMIN,
+ sendto_realops_flags(UMODE_DEBUG, L_ADMIN, SEND_NOTICE,
"Unknown prefix (%s) from %s, Squitting %s",
lbuffer, get_client_name(client_p, SHOW_IP), lsender);
- sendto_realops_flags(UMODE_DEBUG, L_OPER,
+ sendto_realops_flags(UMODE_DEBUG, L_OPER, SEND_NOTICE,
"Unknown prefix (%s) from %s, Squitting %s",
lbuffer, client_p->name, lsender);
sendto_one(client_p, ":%s SQUIT %s :(Unknown prefix (%s) from %s)",
@@ -716,7 +718,7 @@ handle_numeric(char numeric[], struct Client *client_p, struct Client *source_p,
num = atoi(numeric);
if ((num != ERR_NOSUCHNICK))
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"*** %s(via %s) sent a %s numeric to me: %s",
source_p->name, client_p->name, numeric, buffer);
return;
@@ -797,17 +799,21 @@ rfc1459_command_send_error(struct Client *client_p, struct Client *source_p,
if (client_p == source_p)
{
- sendto_realops_flags(UMODE_ALL, L_ADMIN, "ERROR :from %s -- %s",
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
+ "ERROR :from %s -- %s",
get_client_name(client_p, HIDE_IP), in_para);
- sendto_realops_flags(UMODE_ALL, L_OPER, "ERROR :from %s -- %s",
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
+ "ERROR :from %s -- %s",
get_client_name(client_p, MASK_IP), in_para);
}
else
{
- sendto_realops_flags(UMODE_ALL, L_OPER, "ERROR :from %s via %s -- %s",
- source_p->name, get_client_name(client_p, MASK_IP), in_para);
- sendto_realops_flags(UMODE_ALL, L_ADMIN, "ERROR :from %s via %s -- %s",
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
+ "ERROR :from %s via %s -- %s",
source_p->name, get_client_name(client_p, HIDE_IP), in_para);
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
+ "ERROR :from %s via %s -- %s",
+ source_p->name, get_client_name(client_p, MASK_IP), in_para);
}
if (MyClient(source_p))
diff --git a/src/s_bsd.c b/src/s_bsd.c
index 316d3f4..5eaae02 100644
--- a/src/s_bsd.c
+++ b/src/s_bsd.c
@@ -129,7 +129,8 @@ report_error(int level, const char* text, const char* who, int error)
{
who = (who) ? who : "";
- sendto_realops_flags(UMODE_DEBUG, level, text, who, strerror(error));
+ sendto_realops_flags(UMODE_DEBUG, level, SEND_NOTICE,
+ text, who, strerror(error));
ilog(LOG_TYPE_IRCD, text, who, strerror(error));
}
diff --git a/src/s_serv.c b/src/s_serv.c
index 4d7dcd6..ea2da4e 100644
--- a/src/s_serv.c
+++ b/src/s_serv.c
@@ -341,10 +341,12 @@ try_connections(void *unused)
* -- adrian
*/
if (ConfigServerHide.hide_server_ips)
- sendto_realops_flags(UMODE_ALL, L_ALL, "Connection to %s activated.",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Connection to %s activated.",
conf->name);
else
- sendto_realops_flags(UMODE_ALL, L_ALL, "Connection to %s[%s] activated.",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Connection to %s[%s] activated.",
conf->name, aconf->host);
serv_connect(aconf, NULL);
@@ -702,7 +704,8 @@ server_estab(struct Client *client_p)
== NULL)
{
/* This shouldn't happen, better tell the ops... -A1kmm */
- sendto_realops_flags(UMODE_ALL, L_ALL, "Warning: Lost connect{} block "
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Warning: Lost connect{} block "
"for server %s(this shouldn't happen)!", host);
exit_client(client_p, &me, "Lost connect{} block!");
return;
@@ -812,14 +815,14 @@ server_estab(struct Client *client_p)
compression = SSL_get_current_compression(client_p->localClient->fd.ssl);
expansion = SSL_get_current_expansion(client_p->localClient->fd.ssl);
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"Link with %s established: [SSL: %s, Compression/Expansion method: %s/%s] (Capabilities: %s)",
inpath_ip, ssl_get_cipher(client_p->localClient->fd.ssl),
compression ? SSL_COMP_get_name(compression) : "NONE",
expansion ? SSL_COMP_get_name(expansion) : "NONE",
show_capabilities(client_p));
/* Now show the masked hostname/IP to opers */
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"Link with %s established: [SSL: %s, Compression/Expansion method: %s/%s] (Capabilities: %s)",
inpath, ssl_get_cipher(client_p->localClient->fd.ssl),
compression ? SSL_COMP_get_name(compression) : "NONE",
@@ -834,13 +837,13 @@ server_estab(struct Client *client_p)
else
#endif
{
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"Link with %s established: (Capabilities: %s)",
- inpath_ip,show_capabilities(client_p));
+ inpath_ip, show_capabilities(client_p));
/* Now show the masked hostname/IP to opers */
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"Link with %s established: (Capabilities: %s)",
- inpath,show_capabilities(client_p));
+ inpath, show_capabilities(client_p));
ilog(LOG_TYPE_IRCD, "Link with %s established: (Capabilities: %s)",
inpath_ip, show_capabilities(client_p));
}
@@ -1098,7 +1101,7 @@ serv_connect(struct AccessItem *aconf, struct Client *by)
/* Still processing a DNS lookup? -> exit */
if (aconf->dns_pending)
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Error connecting to %s: DNS lookup for connect{} in progress.",
conf->name);
return (0);
@@ -1106,7 +1109,7 @@ serv_connect(struct AccessItem *aconf, struct Client *by)
if (aconf->dns_failed)
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Error connecting to %s: DNS lookup for connect{} failed.",
conf->name);
return (0);
@@ -1117,10 +1120,10 @@ serv_connect(struct AccessItem *aconf, struct Client *by)
*/
if ((client_p = hash_find_server(conf->name)) != NULL)
{
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"Server %s already present from %s",
conf->name, get_client_name(client_p, SHOW_IP));
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"Server %s already present from %s",
conf->name, get_client_name(client_p, MASK_IP));
if (by && IsClient(by) && !MyClient(by))
@@ -1160,8 +1163,8 @@ serv_connect(struct AccessItem *aconf, struct Client *by)
*/
if (!attach_connect_block(client_p, conf->name, aconf->host))
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
- "Host %s is not enabled for connecting:no C/N-line",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "Host %s is not enabled for connecting: no connect{} block",
conf->name);
if (by && IsClient(by) && !MyClient(by))
sendto_one(by, ":%s NOTICE %s :Connect to host %s failed.",
@@ -1282,9 +1285,9 @@ finish_ssl_server_handshake(struct Client *client_p)
client_p->name, SERVER_TYPE);
if (conf == NULL)
{
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"Lost connect{} block for %s", get_client_name(client_p, HIDE_IP));
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"Lost connect{} block for %s", get_client_name(client_p, MASK_IP));
exit_client(client_p, &me, "Lost connect{} block");
@@ -1309,11 +1312,11 @@ finish_ssl_server_handshake(struct Client *client_p)
*/
if (IsDead(client_p))
{
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"%s[%s] went dead during handshake",
client_p->name,
client_p->host);
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"%s went dead during handshake", client_p->name);
return;
}
@@ -1346,7 +1349,7 @@ ssl_server_handshake(fde_t *fd, struct Client *client_p)
default:
{
const char *sslerr = ERR_error_string(ERR_get_error(), NULL);
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Error connecting to %s: %s", client_p->name,
sslerr ? sslerr : "unknown SSL error");
exit_client(client_p, client_p, "Error during SSL handshake");
@@ -1408,15 +1411,15 @@ serv_connect_callback(fde_t *fd, int status, void *data)
* Admins get to see any IP, mere opers don't *sigh*
*/
if (ConfigServerHide.hide_server_ips)
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"Error connecting to %s: %s",
client_p->name, comm_errstr(status));
else
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"Error connecting to %s[%s]: %s", client_p->name,
client_p->host, comm_errstr(status));
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"Error connecting to %s: %s",
client_p->name, comm_errstr(status));
@@ -1433,9 +1436,9 @@ serv_connect_callback(fde_t *fd, int status, void *data)
client_p->name, SERVER_TYPE);
if (conf == NULL)
{
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"Lost connect{} block for %s", get_client_name(client_p, HIDE_IP));
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"Lost connect{} block for %s", get_client_name(client_p, MASK_IP));
exit_client(client_p, &me, "Lost connect{} block");
@@ -1470,11 +1473,11 @@ serv_connect_callback(fde_t *fd, int status, void *data)
*/
if (IsDead(client_p))
{
- sendto_realops_flags(UMODE_ALL, L_ADMIN,
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
"%s[%s] went dead during handshake",
client_p->name,
client_p->host);
- sendto_realops_flags(UMODE_ALL, L_OPER,
+ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
"%s went dead during handshake", client_p->name);
return;
}
diff --git a/src/s_user.c b/src/s_user.c
index 1973bfa..cb8cc61 100644
--- a/src/s_user.c
+++ b/src/s_user.c
@@ -390,7 +390,7 @@ register_local_user(struct Client *source_p)
if ((Count.local >= ServerInfo.max_clients + MAX_BUFFER) ||
(Count.local >= ServerInfo.max_clients && !IsExemptLimits(source_p)))
{
- sendto_realops_flags(UMODE_FULL, L_ALL,
+ sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE,
"Too many clients, rejecting %s[%s].",
source_p->name, source_p->host);
++ServerStats.is_ref;
@@ -403,7 +403,8 @@ register_local_user(struct Client *source_p)
{
char tmpstr2[IRCD_BUFSIZE];
- sendto_realops_flags(UMODE_REJ, L_ALL, "Invalid username: %s (%s@%s)",
+ sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE,
+ "Invalid username: %s (%s@%s)",
source_p->name, source_p->username, source_p->host);
++ServerStats.is_ref;
snprintf(tmpstr2, sizeof(tmpstr2), "Invalid username [%s]",
@@ -421,7 +422,7 @@ register_local_user(struct Client *source_p)
strlcpy(source_p->id, id, sizeof(source_p->id));
hash_add_id(source_p);
- sendto_realops_flags(UMODE_CCONN, L_ALL,
+ sendto_realops_flags(UMODE_CCONN, L_ALL, SEND_NOTICE,
"Client connecting: %s (%s@%s) [%s] {%s} [%s] <%s>",
source_p->name, source_p->username, source_p->host,
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
@@ -429,7 +430,7 @@ register_local_user(struct Client *source_p)
get_client_class(source_p),
source_p->info, source_p->id);
- sendto_realops_flags(UMODE_CCONN_FULL, L_ALL,
+ sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, SEND_NOTICE,
"CLICONN %s %s %s %s %s %s %s 0 %s",
source_p->name, source_p->username, source_p->host,
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ?
@@ -453,7 +454,8 @@ register_local_user(struct Client *source_p)
Count.max_loc = Count.local;
if (!(Count.max_loc % 10))
- sendto_realops_flags(UMODE_ALL, L_ALL, "New Max Local Clients: %d",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
+ "New Max Local Clients: %d",
Count.max_loc);
}
@@ -509,13 +511,14 @@ register_remote_user(struct Client *source_p,
*/
source_p->servptr = hash_find_server(server);
- /* Super GhostDetect:
+ /*
+ * Super GhostDetect:
* If we can't find the server the user is supposed to be on,
* then simply blow the user away. -Taner
*/
if (source_p->servptr == NULL)
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"No server %s for user %s[%s@%s] from %s",
server, source_p->name, source_p->username,
source_p->host, source_p->from->name);
@@ -528,7 +531,7 @@ register_remote_user(struct Client *source_p,
if ((target_p = source_p->servptr) && target_p->from != source_p->from)
{
- sendto_realops_flags(UMODE_DEBUG, L_ALL,
+ sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
"Bad User [%s] :%s USER %s@%s %s, != %s[%s]",
source_p->from->name, source_p->name, source_p->username,
source_p->host, source_p->servptr->name,
@@ -848,7 +851,8 @@ set_user_mode(struct Client *client_p, struct Client *source_p,
if (IsServer(source_p))
{
- sendto_realops_flags(UMODE_ALL, L_ADMIN, "*** Mode for User %s from %s",
+ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
+ "*** Mode for User %s from %s",
parv[1], source_p->name);
return;
}
@@ -1169,7 +1173,7 @@ check_xline(struct Client *source_p)
else
reason = "No Reason";
- sendto_realops_flags(UMODE_REJ, L_ALL,
+ sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE,
"X-line Rejecting [%s] [%s], user %s [%s]",
source_p->info, reason,
get_client_name(source_p, HIDE_IP),
@@ -1223,7 +1227,7 @@ oper_up(struct Client *source_p)
if (!HasOFlag(source_p, OPER_FLAG_N))
DelUMode(source_p, UMODE_NCHANGE);
- sendto_realops_flags(UMODE_ALL, L_ALL, "%s is now an operator",
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s is now an operator",
get_oper_name(source_p));
send_umode_out(source_p, source_p, old);
sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name);
diff --git a/src/send.c b/src/send.c
index afa684e..53804b3 100644
--- a/src/send.c
+++ b/src/send.c
@@ -109,7 +109,7 @@ send_message(struct Client *to, char *buf, int len)
if (dbuf_length(&to->localClient->buf_sendq) + len > get_sendq(to))
{
if (IsServer(to))
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Max SendQ limit exceeded for %s: %lu > %lu",
get_client_name(to, HIDE_IP),
(unsigned long)(dbuf_length(&to->localClient->buf_sendq) + len),
@@ -152,7 +152,7 @@ send_message_remote(struct Client *to, struct Client *from,
{
if (!MyConnect(to))
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"server send message to %s [%s] dropped from %s(Not local server)",
to->name, to->from->name, from->name);
return;
@@ -165,13 +165,13 @@ send_message_remote(struct Client *to, struct Client *from,
{
if (IsServer(from))
{
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Send message to %s [%s] dropped from %s(Fake Dir)",
to->name, to->from->name, from->name);
return;
}
- sendto_realops_flags(UMODE_ALL, L_ALL,
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Ghosted: %s[%s@%s] from %s[%s@%s] (%s)",
to->name, to->username, to->host,
from->name, from->username, from->host,
@@ -892,60 +892,48 @@ sendto_anywhere(struct Client *to, struct Client *from,
* side effects - Send to *local* ops only but NOT +s nonopers.
*/
void
-sendto_realops_flags(unsigned int flags, int level, const char *pattern, ...)
+sendto_realops_flags(unsigned int flags, int level, int type, const char *pattern, ...)
{
+ const char *ntype = NULL;
dlink_node *ptr = NULL;
char nbuf[IRCD_BUFSIZE];
va_list args;
va_start(args, pattern);
- vsnprintf(nbuf, IRCD_BUFSIZE, pattern, args);
+ vsnprintf(nbuf, sizeof(nbuf), pattern, args);
va_end(args);
- DLINK_FOREACH(ptr, oper_list.head)
+ switch (type)
{
- struct Client *client_p = ptr->data;
- assert(HasUMode(client_p, UMODE_OPER));
-
- /* If we're sending it to opers and theyre an admin, skip.
- * If we're sending it to admins, and theyre not, skip.
- */
- if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) ||
- ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN)))
- continue;
-
- if (HasUMode(client_p, flags))
- sendto_one(client_p, ":%s NOTICE %s :*** Notice -- %s",
- me.name, client_p->name, nbuf);
+ case SEND_NOTICE:
+ ntype = "Notice";
+ break;
+ case SEND_GLOBAL:
+ ntype = "Global";
+ break;
+ case SEND_LOCOPS:
+ ntype = "LocOps";
+ break;
+ default:
+ assert(0);
}
-}
-
-void
-sendto_globops_flags(unsigned int flags, int level, const char *pattern, ...)
-{
- dlink_node *ptr = NULL;
- char nbuf[IRCD_BUFSIZE];
- va_list args;
-
- va_start(args, pattern);
- vsnprintf(nbuf, IRCD_BUFSIZE, pattern, args);
- va_end(args);
DLINK_FOREACH(ptr, oper_list.head)
{
struct Client *client_p = ptr->data;
- assert(client_p->umodes & UMODE_OPER);
+ assert(HasUMode(client_p, UMODE_OPER));
- /* If we're sending it to opers and theyre an admin, skip.
- * If we're sending it to admins, and theyre not, skip.
+ /*
+ * If we're sending it to opers and they're an admin, skip.
+ * If we're sending it to admins, and they're not, skip.
*/
if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) ||
- ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN)))
+ ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN)))
continue;
if (HasUMode(client_p, flags))
- sendto_one(client_p, ":%s NOTICE %s :*** Global -- %s",
- me.name, client_p->name, nbuf);
+ sendto_one(client_p, ":%s NOTICE %s :*** %s -- %s",
+ me.name, client_p->name, ntype, nbuf);
}
}
@@ -1023,7 +1011,7 @@ ts_warn(const char *pattern, ...)
vsnprintf(buffer, sizeof(buffer), pattern, args);
va_end(args);
- sendto_realops_flags(UMODE_ALL, L_ALL, "%s", buffer);
+ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s", buffer);
ilog(LOG_TYPE_IRCD, "%s", buffer);
}