109 |
|
if (dbuf_length(&to->localClient->buf_sendq) + len > get_sendq(to)) |
110 |
|
{ |
111 |
|
if (IsServer(to)) |
112 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
112 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
113 |
|
"Max SendQ limit exceeded for %s: %lu > %lu", |
114 |
|
get_client_name(to, HIDE_IP), |
115 |
|
(unsigned long)(dbuf_length(&to->localClient->buf_sendq) + len), |
152 |
|
{ |
153 |
|
if (!MyConnect(to)) |
154 |
|
{ |
155 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
155 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
156 |
|
"server send message to %s [%s] dropped from %s(Not local server)", |
157 |
|
to->name, to->from->name, from->name); |
158 |
|
return; |
165 |
|
{ |
166 |
|
if (IsServer(from)) |
167 |
|
{ |
168 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
168 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
169 |
|
"Send message to %s [%s] dropped from %s(Fake Dir)", |
170 |
|
to->name, to->from->name, from->name); |
171 |
|
return; |
172 |
|
} |
173 |
|
|
174 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
174 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
175 |
|
"Ghosted: %s[%s@%s] from %s[%s@%s] (%s)", |
176 |
|
to->name, to->username, to->host, |
177 |
|
from->name, from->username, from->host, |
892 |
|
* side effects - Send to *local* ops only but NOT +s nonopers. |
893 |
|
*/ |
894 |
|
void |
895 |
< |
sendto_realops_flags(unsigned int flags, int level, const char *pattern, ...) |
895 |
> |
sendto_realops_flags(unsigned int flags, int level, int type, const char *pattern, ...) |
896 |
|
{ |
897 |
+ |
const char *ntype = NULL; |
898 |
|
dlink_node *ptr = NULL; |
899 |
|
char nbuf[IRCD_BUFSIZE]; |
900 |
|
va_list args; |
901 |
|
|
902 |
|
va_start(args, pattern); |
903 |
< |
vsnprintf(nbuf, IRCD_BUFSIZE, pattern, args); |
903 |
> |
vsnprintf(nbuf, sizeof(nbuf), pattern, args); |
904 |
|
va_end(args); |
905 |
|
|
906 |
< |
DLINK_FOREACH(ptr, oper_list.head) |
906 |
> |
switch (type) |
907 |
|
{ |
908 |
< |
struct Client *client_p = ptr->data; |
909 |
< |
assert(HasUMode(client_p, UMODE_OPER)); |
910 |
< |
|
911 |
< |
/* If we're sending it to opers and theyre an admin, skip. |
912 |
< |
* If we're sending it to admins, and theyre not, skip. |
913 |
< |
*/ |
914 |
< |
if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) || |
915 |
< |
((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN))) |
916 |
< |
continue; |
917 |
< |
|
918 |
< |
if (HasUMode(client_p, flags)) |
918 |
< |
sendto_one(client_p, ":%s NOTICE %s :*** Notice -- %s", |
919 |
< |
me.name, client_p->name, nbuf); |
908 |
> |
case SEND_NOTICE: |
909 |
> |
ntype = "Notice"; |
910 |
> |
break; |
911 |
> |
case SEND_GLOBAL: |
912 |
> |
ntype = "Global"; |
913 |
> |
break; |
914 |
> |
case SEND_LOCOPS: |
915 |
> |
ntype = "LocOps"; |
916 |
> |
break; |
917 |
> |
default: |
918 |
> |
assert(0); |
919 |
|
} |
921 |
– |
} |
922 |
– |
|
923 |
– |
void |
924 |
– |
sendto_globops_flags(unsigned int flags, int level, const char *pattern, ...) |
925 |
– |
{ |
926 |
– |
dlink_node *ptr = NULL; |
927 |
– |
char nbuf[IRCD_BUFSIZE]; |
928 |
– |
va_list args; |
929 |
– |
|
930 |
– |
va_start(args, pattern); |
931 |
– |
vsnprintf(nbuf, IRCD_BUFSIZE, pattern, args); |
932 |
– |
va_end(args); |
920 |
|
|
921 |
|
DLINK_FOREACH(ptr, oper_list.head) |
922 |
|
{ |
923 |
|
struct Client *client_p = ptr->data; |
924 |
< |
assert(client_p->umodes & UMODE_OPER); |
924 |
> |
assert(HasUMode(client_p, UMODE_OPER)); |
925 |
|
|
926 |
< |
/* If we're sending it to opers and theyre an admin, skip. |
927 |
< |
* If we're sending it to admins, and theyre not, skip. |
926 |
> |
/* |
927 |
> |
* If we're sending it to opers and they're an admin, skip. |
928 |
> |
* If we're sending it to admins, and they're not, skip. |
929 |
|
*/ |
930 |
|
if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) || |
931 |
< |
((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN))) |
931 |
> |
((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN))) |
932 |
|
continue; |
933 |
|
|
934 |
|
if (HasUMode(client_p, flags)) |
935 |
< |
sendto_one(client_p, ":%s NOTICE %s :*** Global -- %s", |
936 |
< |
me.name, client_p->name, nbuf); |
935 |
> |
sendto_one(client_p, ":%s NOTICE %s :*** %s -- %s", |
936 |
> |
me.name, client_p->name, ntype, nbuf); |
937 |
|
} |
938 |
|
} |
939 |
|
|
1011 |
|
vsnprintf(buffer, sizeof(buffer), pattern, args); |
1012 |
|
va_end(args); |
1013 |
|
|
1014 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, "%s", buffer); |
1014 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s", buffer); |
1015 |
|
ilog(LOG_TYPE_IRCD, "%s", buffer); |
1016 |
|
} |
1017 |
|
|