} /* Client_HasMode */
+GLOBAL bool
+Client_HasFlag( CLIENT *Client, char Flag )
+{
+ assert( Client != NULL );
+ return strchr( Client->flags, Flag ) != NULL;
+} /* Client_HasFlag */
+
+
GLOBAL char *
Client_Away( CLIENT *Client )
{
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 ));
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);
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;
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);
/* 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;