Add capability parameter to sendto_common_channels_local() and sendto_common_channels_local_butone().
This commit is contained in:
parent
0b2b2f7753
commit
7a948bdaa7
6 changed files with 16 additions and 12 deletions
|
@ -63,8 +63,8 @@ extern void sendto_channel_opmod(struct Client *one, struct Client *source_p,
|
|||
|
||||
extern void sendto_channel_local(int type, struct Channel *, const char *, ...) AFP(3, 4);
|
||||
extern void sendto_channel_local_butone(struct Client *, int type, struct Channel *, const char *, ...) AFP(4, 5);
|
||||
extern void sendto_common_channels_local(struct Client *, const char *, ...) AFP(2, 3);
|
||||
extern void sendto_common_channels_local_butone(struct Client *, const char *, ...) AFP(2, 3);
|
||||
extern void sendto_common_channels_local(struct Client *, int cap, const char *, ...) AFP(3, 4);
|
||||
extern void sendto_common_channels_local_butone(struct Client *, int cap, const char *, ...) AFP(3, 4);
|
||||
|
||||
|
||||
extern void sendto_match_butone(struct Client *, struct Client *,
|
||||
|
|
|
@ -728,7 +728,7 @@ change_local_nick(struct Client *client_p, struct Client *source_p,
|
|||
source_p->name, nick, source_p->username, source_p->host);
|
||||
|
||||
/* send the nick change to the users channels */
|
||||
sendto_common_channels_local(source_p, ":%s!%s@%s NICK :%s",
|
||||
sendto_common_channels_local(source_p, NOCAPS, ":%s!%s@%s NICK :%s",
|
||||
source_p->name, source_p->username, source_p->host, nick);
|
||||
|
||||
/* send the nick change to servers.. */
|
||||
|
@ -789,7 +789,7 @@ change_remote_nick(struct Client *client_p, struct Client *source_p,
|
|||
monitor_signoff(source_p);
|
||||
}
|
||||
|
||||
sendto_common_channels_local(source_p, ":%s!%s@%s NICK :%s",
|
||||
sendto_common_channels_local(source_p, NOCAPS, ":%s!%s@%s NICK :%s",
|
||||
source_p->name, source_p->username, source_p->host, nick);
|
||||
|
||||
if(source_p->user)
|
||||
|
|
|
@ -217,7 +217,7 @@ me_rsfnc(struct Client *client_p, struct Client *source_p,
|
|||
target_p->name, parv[2], target_p->username,
|
||||
target_p->host);
|
||||
|
||||
sendto_common_channels_local(target_p, ":%s!%s@%s NICK :%s",
|
||||
sendto_common_channels_local(target_p, NOCAPS, ":%s!%s@%s NICK :%s",
|
||||
target_p->name, target_p->username,
|
||||
target_p->host, parv[2]);
|
||||
|
||||
|
|
|
@ -1140,7 +1140,7 @@ exit_generic_client(struct Client *client_p, struct Client *source_p, struct Cli
|
|||
if(IsOper(source_p))
|
||||
rb_dlinkFindDestroy(source_p, &oper_list);
|
||||
|
||||
sendto_common_channels_local(source_p, ":%s!%s@%s QUIT :%s",
|
||||
sendto_common_channels_local(source_p, NOCAPS, ":%s!%s@%s QUIT :%s",
|
||||
source_p->name,
|
||||
source_p->username, source_p->host, comment);
|
||||
|
||||
|
|
|
@ -1429,7 +1429,7 @@ change_nick_user_host(struct Client *target_p, const char *nick, const char *use
|
|||
vsnprintf(reason, 255, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
sendto_common_channels_local_butone(target_p, ":%s!%s@%s QUIT :%s",
|
||||
sendto_common_channels_local_butone(target_p, NOCAPS, ":%s!%s@%s QUIT :%s",
|
||||
target_p->name, target_p->username, target_p->host,
|
||||
reason);
|
||||
|
||||
|
@ -1471,7 +1471,7 @@ change_nick_user_host(struct Client *target_p, const char *nick, const char *use
|
|||
}
|
||||
else if(changed_case)
|
||||
{
|
||||
sendto_common_channels_local(target_p, ":%s!%s@%s NICK :%s",
|
||||
sendto_common_channels_local(target_p, NOCAPS, ":%s!%s@%s NICK :%s",
|
||||
target_p->name, target_p->username,
|
||||
target_p->host, nick);
|
||||
}
|
||||
|
|
12
src/send.c
12
src/send.c
|
@ -702,6 +702,7 @@ sendto_channel_local_butone(struct Client *one, int type, struct Channel *chptr,
|
|||
* sendto_common_channels_local()
|
||||
*
|
||||
* inputs - pointer to client
|
||||
* - capability mask
|
||||
* - pattern to send
|
||||
* output - NONE
|
||||
* side effects - Sends a message to all people on local server who are
|
||||
|
@ -709,7 +710,7 @@ sendto_channel_local_butone(struct Client *one, int type, struct Channel *chptr,
|
|||
* used by m_nick.c and exit_one_client.
|
||||
*/
|
||||
void
|
||||
sendto_common_channels_local(struct Client *user, const char *pattern, ...)
|
||||
sendto_common_channels_local(struct Client *user, int cap, const char *pattern, ...)
|
||||
{
|
||||
va_list args;
|
||||
rb_dlink_node *ptr;
|
||||
|
@ -740,7 +741,8 @@ sendto_common_channels_local(struct Client *user, const char *pattern, ...)
|
|||
target_p = msptr->client_p;
|
||||
|
||||
if(IsIOError(target_p) ||
|
||||
target_p->serial == current_serial)
|
||||
target_p->serial == current_serial ||
|
||||
!IsCapable(target_p, cap))
|
||||
continue;
|
||||
|
||||
target_p->serial = current_serial;
|
||||
|
@ -761,13 +763,14 @@ sendto_common_channels_local(struct Client *user, const char *pattern, ...)
|
|||
* sendto_common_channels_local_butone()
|
||||
*
|
||||
* inputs - pointer to client
|
||||
* - capability mask
|
||||
* - pattern to send
|
||||
* output - NONE
|
||||
* side effects - Sends a message to all people on local server who are
|
||||
* in same channel with user, except for user itself.
|
||||
*/
|
||||
void
|
||||
sendto_common_channels_local_butone(struct Client *user, const char *pattern, ...)
|
||||
sendto_common_channels_local_butone(struct Client *user, int cap, const char *pattern, ...)
|
||||
{
|
||||
va_list args;
|
||||
rb_dlink_node *ptr;
|
||||
|
@ -800,7 +803,8 @@ sendto_common_channels_local_butone(struct Client *user, const char *pattern, ..
|
|||
target_p = msptr->client_p;
|
||||
|
||||
if(IsIOError(target_p) ||
|
||||
target_p->serial == current_serial)
|
||||
target_p->serial == current_serial ||
|
||||
!IsCapable(target_p, cap))
|
||||
continue;
|
||||
|
||||
target_p->serial = current_serial;
|
||||
|
|
Loading…
Reference in a new issue