mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-09 02:43:12 +02:00
/NOTICE $* did not work. Fix broken sendto_match_butone(). Reported by blank (#4422).
This commit is contained in:
+10
-1
@@ -408,8 +408,17 @@ int m_message(aClient *cptr, aClient *sptr, int parc, char *parv[], int notice)
|
||||
|
||||
|
||||
/* Message to $servermask */
|
||||
if ((*nick == '$' || *nick == '#') && ValidatePermissionsForPath("notice:global",sptr,NULL,NULL,NULL))
|
||||
if (*nick == '$')
|
||||
{
|
||||
if (!ValidatePermissionsForPath("notice:global", sptr, NULL, NULL, NULL))
|
||||
{
|
||||
/* Apparently no other IRCd does this, but I think it's confusing not to
|
||||
* send an error message, especially with our new privilege system.
|
||||
* Error message could be more descriptive perhaps.
|
||||
*/
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, sptr->name);
|
||||
continue;
|
||||
}
|
||||
sendto_match_butone(IsServer(cptr) ? cptr : NULL,
|
||||
sptr, nick + 1,
|
||||
(*nick == '#') ? MATCH_HOST :
|
||||
|
||||
+20
-24
@@ -707,34 +707,30 @@ void sendto_match_butone(aClient *one, aClient *from, char *mask, int what,
|
||||
else
|
||||
cansendlocal = cansendglobal = 1;
|
||||
|
||||
list_for_each_entry(cptr, &server_list, special_node)
|
||||
/* To servers... */
|
||||
if (cansendglobal)
|
||||
{
|
||||
if (cptr == one) /* must skip the origin !! */
|
||||
continue;
|
||||
if (IsServer(cptr))
|
||||
{
|
||||
if (!cansendglobal)
|
||||
continue;
|
||||
list_for_each_entry(acptr, &client_list, client_node)
|
||||
if (IsRegisteredUser(acptr)
|
||||
&& match_it(acptr, mask, what)
|
||||
&& acptr->from == cptr)
|
||||
break;
|
||||
/* a person on that server matches the mask, so we
|
||||
** send *one* msg to that server ...
|
||||
*/
|
||||
if (acptr == NULL)
|
||||
continue;
|
||||
/* ... but only if there *IS* a matching person */
|
||||
}
|
||||
/* my client, does he match ? */
|
||||
else if (!cansendlocal || (!(IsRegisteredUser(cptr) &&
|
||||
match_it(cptr, mask, what))))
|
||||
continue;
|
||||
char buf[512];
|
||||
|
||||
va_start(vl, pattern);
|
||||
vsendto_prefix_one(cptr, from, pattern, vl);
|
||||
ircvsnprintf(buf, sizeof(buf), pattern, vl);
|
||||
va_end(vl);
|
||||
|
||||
sendto_server(one, 0, 0, "%s", buf);
|
||||
}
|
||||
|
||||
/* To local clients... */
|
||||
if (cansendlocal)
|
||||
{
|
||||
list_for_each_entry(cptr, &lclient_list, lclient_node)
|
||||
{
|
||||
if (!IsMe(cptr) && (cptr != one) && IsRegisteredUser(cptr) && match_it(cptr, mask, what))
|
||||
{
|
||||
va_start(vl, pattern);
|
||||
vsendto_prefix_one(cptr, from, pattern, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user