commit - a95d3e05e7c01fb82981898cdcfe162d727952bc
commit + e03d8eb7284147f7d44ff192cec18ad9716fedff
blob - 9358dbb5fb281db125dd448c8e50c4098b6e34b5
blob + 7821d3bd6b7ae29d679bedbeb97dfb96285c3978
--- src/ngircd/client.c
+++ src/ngircd/client.c
assert( Client != NULL );
return strchr( Client->modes, Mode ) != NULL;
} /* Client_HasMode */
+
+
+GLOBAL bool
+Client_HasFlag( CLIENT *Client, char Flag )
+{
+ assert( Client != NULL );
+ return strchr( Client->flags, Flag ) != NULL;
+} /* Client_HasFlag */
GLOBAL char *
blob - 68d411c04f0a1625b9cb714e7d5c6cba5b74dae7
blob + 94ca4dc5fdbf1018ebb3a95563524f60cf582334
--- src/ngircd/client.h
+++ src/ngircd/client.h
GLOBAL time_t Client_StartTime PARAMS(( CLIENT *Client ));
GLOBAL bool Client_HasMode PARAMS(( CLIENT *Client, char Mode ));
+GLOBAL bool Client_HasFlag PARAMS(( CLIENT *Client, char Flag ));
GLOBAL void Client_SetHostname PARAMS(( CLIENT *Client, const char *Hostname ));
GLOBAL void Client_SetID PARAMS(( CLIENT *Client, const char *Nick ));
blob - d185488b500789af68a4a8253adc313a918d16f9
blob + 3c8a4a85623bc9c6ccaf53180e49a2170a38fa0f
--- src/ngircd/irc-metadata.c
+++ src/ngircd/irc-metadata.c
Req->argv[1], Req->argv[2]);
/* Mark client: it has receiveda a METADATA command */
- if (!strchr(Client_Flags(target), 'M')) {
+ if (!Client_HasFlag(target, 'M')) {
snprintf(new_flags, sizeof new_flags, "%sM",
Client_Flags(target));
Client_SetFlags(target, new_flags);
blob - 8fc575f3d86597b9576fb6f2cc503b292264680a
blob + d8e4b29ace707d26583a00e8c828c77d002887ce
--- src/ngircd/irc-server.c
+++ src/ngircd/irc-server.c
Client_SetType(Client, CLIENT_UNKNOWNSERVER);
#ifdef ZLIB
- if (strchr(Client_Flags(Client), 'Z')
+ if (Client_HasFlag(Client, 'Z')
&& !Zip_InitConn(Client_Conn(Client))) {
Conn_Close(Client_Conn(Client),
"Can't initialize compression (zlib)!",
#endif
#ifdef IRCPLUS
- if (strchr(Client_Flags(Client), 'H')) {
+ if (Client_HasFlag(Client, 'H')) {
LogDebug("Peer supports IRC+ extended server handshake ...");
if (!IRC_Send_ISUPPORT(Client))
return DISCONNECTED;
blob - 16aac9a081859aa27904e116252d009ba02d3176
blob + fd0f85a7151f749432e98aff2271e2417f992248
--- src/ngircd/irc-write.c
+++ src/ngircd/irc-write.c
if (Client_Type(c) == CLIENT_SERVER && Client_Conn(c) > NONE &&
c != Client_ThisServer() && c != ExceptOf) {
/* Found a target server, do the flags match? */
- if (Flag == '\0' || strchr(Client_Flags(c), Flag))
+ if (Flag == '\0' || Client_HasFlag(c, Flag))
callback(c, Prefix, cb_data);
}
c = Client_Next(c);
blob - 01091edef17272a9bfaf26f67064c709fdc95486
blob + f2c61e8a8cb46ea0b7b7649ad73b76c7f9db438a
--- src/ngircd/numeric.c
+++ src/ngircd/numeric.c
/* Check features of remote server */
njoin = Conn_Options(Client_Conn(Client)) & CONN_RFC1459 ? false : true;
- xop = strchr(Client_Flags(Client), 'X') ? true : false;
+ xop = Client_HasFlag(Client, 'X') ? true : false;
/* Get all the members of this channel */
cl2chan = Channel_FirstMember(Chan);
}
#ifdef IRCPLUS
/* Send CHANINFO if the peer supports it */
- if (strchr(Client_Flags(Client), 'C')) {
+ if (Client_HasFlag(Client, 'C')) {
if (!Send_CHANINFO(Client, chan))
return DISCONNECTED;
}
}
#ifdef IRCPLUS
- if (strchr(Client_Flags(Client), 'L')) {
+ if (Client_HasFlag(Client, 'L')) {
LogDebug("Synchronizing INVITE- and BAN-lists ...");
if (!Synchronize_Lists(Client))
return DISCONNECTED;