mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-01 02:16:38 +02:00
Rename CHECKPROTO() to CHECKSERVERPROTO() to avoid mixing up server caps
and client caps in the future.
This commit is contained in:
+7
-7
@@ -492,16 +492,16 @@ typedef enum ClientStatus {
|
||||
|
||||
/* PROTOCTL (Server protocol) stuff */
|
||||
#ifndef DEBUGMODE
|
||||
#define CHECKPROTO(x,y) (((x)->local->proto & y) == y)
|
||||
#define CHECKSERVERPROTO(x,y) (((x)->local->proto & y) == y)
|
||||
#else
|
||||
#define CHECKPROTO(x,y) (checkprotoflags(x, y, __FILE__, __LINE__))
|
||||
#define CHECKSERVERPROTO(x,y) (checkprotoflags(x, y, __FILE__, __LINE__))
|
||||
#endif
|
||||
|
||||
#define SupportVL(x) (CHECKPROTO(x, PROTO_VL))
|
||||
#define SupportSJSBY(x) (CHECKPROTO(x, PROTO_SJSBY))
|
||||
#define SupportVHP(x) (CHECKPROTO(x, PROTO_VHP))
|
||||
#define SupportCLK(x) (CHECKPROTO(x, PROTO_CLK))
|
||||
#define SupportMTAGS(x) (CHECKPROTO(x, PROTO_MTAGS))
|
||||
#define SupportVL(x) (CHECKSERVERPROTO(x, PROTO_VL))
|
||||
#define SupportSJSBY(x) (CHECKSERVERPROTO(x, PROTO_SJSBY))
|
||||
#define SupportVHP(x) (CHECKSERVERPROTO(x, PROTO_VHP))
|
||||
#define SupportCLK(x) (CHECKSERVERPROTO(x, PROTO_CLK))
|
||||
#define SupportMTAGS(x) (CHECKSERVERPROTO(x, PROTO_MTAGS))
|
||||
|
||||
#define SetVL(x) ((x)->local->proto |= PROTO_VL)
|
||||
#define SetSJSBY(x) ((x)->local->proto |= PROTO_SJSBY)
|
||||
|
||||
@@ -787,7 +787,7 @@ void _introduce_user(Client *to, Client *acptr)
|
||||
SWhois *s;
|
||||
for (s = acptr->user->swhois; s; s = s->next)
|
||||
{
|
||||
if (CHECKPROTO(to, PROTO_EXTSWHOIS))
|
||||
if (CHECKSERVERPROTO(to, PROTO_EXTSWHOIS))
|
||||
{
|
||||
sendto_one(to, NULL, ":%s SWHOIS %s + %s %d :%s",
|
||||
me.id, acptr->name, s->setby, s->priority, s->line);
|
||||
|
||||
+10
-23
@@ -458,28 +458,15 @@ good:
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* sendto_server
|
||||
*
|
||||
* inputs - pointer to client to NOT send to
|
||||
* - caps or'd together which must ALL be present
|
||||
* - caps or'd together which must ALL NOT be present
|
||||
* - printf style format string
|
||||
* - args to format string
|
||||
* output - NONE
|
||||
* side effects - Send a message to all connected servers, except the
|
||||
* client 'one' (if non-NULL), as long as the servers
|
||||
* support ALL capabs in 'caps', and NO capabs in 'nocaps'.
|
||||
*
|
||||
* This function was written in an attempt to merge together the other
|
||||
* billion sendto_*serv*() functions, which sprung up with capabs, uids etc
|
||||
* -davidt
|
||||
*
|
||||
* Ported this function over from charybdis 3.5, as it is much cleaner than
|
||||
* what we had going on here.
|
||||
* - kaniini
|
||||
/** Send a message to a server, taking into account server options if needed.
|
||||
* @param one The client to skip (can be NULL)
|
||||
* @param servercaps Server capabilities which must be present (OR'd together, if multiple)
|
||||
* @param noservercaps Server capabilities which must NOT be present (OR'd together, if multiple)
|
||||
* @param mtags The message tags to attach to this message.
|
||||
* @param format The format string / pattern, such as ":%s NICK %s".
|
||||
* @param ... The parameters for the format string
|
||||
*/
|
||||
void sendto_server(Client *one, unsigned long caps, unsigned long nocaps, MessageTag *mtags, FORMAT_STRING(const char *format), ...)
|
||||
void sendto_server(Client *one, unsigned long servercaps, unsigned long noservercaps, MessageTag *mtags, FORMAT_STRING(const char *format), ...)
|
||||
{
|
||||
Client *acptr;
|
||||
|
||||
@@ -494,10 +481,10 @@ void sendto_server(Client *one, unsigned long caps, unsigned long nocaps, Messag
|
||||
if (one && acptr == one->direction)
|
||||
continue;
|
||||
|
||||
if (caps && !CHECKPROTO(acptr, caps))
|
||||
if (servercaps && !CHECKSERVERPROTO(acptr, servercaps))
|
||||
continue;
|
||||
|
||||
if (nocaps && CHECKPROTO(acptr, nocaps))
|
||||
if (noservercaps && CHECKSERVERPROTO(acptr, noservercaps))
|
||||
continue;
|
||||
|
||||
va_start(vl, format);
|
||||
|
||||
Reference in New Issue
Block a user