assert (Req != NULL);
if (Client_Type(Client) != CLIENT_SERVER && !Client_OperByMe(Client))
- return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG,
+ return IRC_WriteErrClient(Client, ERR_NOPRIVILEGES_MSG,
Client_ID(Client));
_IRC_ARGC_EQ_OR_RETURN_(Client, Req, 2)
msg = ERR_CANTKILLSERVER_MSG;
else
msg = ERR_NOPRIVILEGES_MSG;
- return IRC_WriteStrClient(Client, msg,
+ return IRC_WriteErrClient(Client, msg,
Client_ID(Client));
}
/* Bad number of arguments? */
if (Req->argc > 1)
- return IRC_WriteStrClient(Client, ERR_NORECIPIENT_MSG,
+ return IRC_WriteErrClient(Client, ERR_NORECIPIENT_MSG,
Client_ID(Client), Req->command);
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
return DISCONNECTED;
}
if (Client_Type(c) == CLIENT_USER
- && strchr(Client_Modes(c), 'o')) {
+ && Client_HasMode(c, 'o')) {
/* IRC Operator */
if (!IRC_WriteStrClient(from,
RPL_TRACEOPERATOR_MSG,
return CONNECTED;
}
+/**
+ * Get pointer to a static string representing the connection "options".
+ *
+ * @param Idx Connection index.
+ * @return Pointer to static (global) string buffer.
+ */
static char *
#ifdef ZLIB
Option_String(CONN_ID Idx)
static char option_txt[8];
#ifdef ZLIB
UINT16 options;
-
- options = Conn_Options(Idx);
#endif
+ assert(Idx != NONE);
+
+ options = Conn_Options(Idx);
strcpy(option_txt, "F"); /* No idea what this means, but the
* original ircd sends it ... */
+#ifdef SSL_SUPPORT
+ if(options & CONN_SSL) /* SSL encrypted link */
+ strlcat(option_txt, "s", sizeof(option_txt));
+#endif
#ifdef ZLIB
- if(options & CONN_ZIP) /* zlib compression supported. */
- strcat(option_txt, "z");
+ if(options & CONN_ZIP) /* zlib compression enabled */
+ strlcat(option_txt, "z", sizeof(option_txt));
#endif
+ LogDebug(" *** %d: %d = %s", Idx, options, option_txt);
return option_txt;
} /* Option_String */
if (Req->argc == 0) {
if (!SendErrors)
return CONNECTED;
- return IRC_WriteStrClient(Client, ERR_NORECIPIENT_MSG,
+ return IRC_WriteErrClient(Client, ERR_NORECIPIENT_MSG,
Client_ID(Client), Req->command);
}
if (Req->argc == 1) {
if (!SendErrors)
return CONNECTED;
- return IRC_WriteStrClient(Client, ERR_NOTEXTTOSEND_MSG,
+ return IRC_WriteErrClient(Client, ERR_NOTEXTTOSEND_MSG,
Client_ID(Client));
}
if (Req->argc > 2) {
if (!SendErrors)
return CONNECTED;
- return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
Client_ID(Client), Req->command);
}
else
from = Client;
if (!from)
- return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
+ return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG,
Client_ID(Client), Req->prefix);
#ifdef ICONV
#else
if (Client_Type(cl) != ForceType) {
#endif
- if (SendErrors && !IRC_WriteStrClient(
+ if (SendErrors && !IRC_WriteErrClient(
from, ERR_NOSUCHNICK_MSG,Client_ID(from),
currentTarget))
return DISCONNECTED;
!Client_HasMode(from, 'o') &&
!(Client_Type(from) == CLIENT_SERVER) &&
!(Client_Type(from) == CLIENT_SERVICE)) {
- if (SendErrors && !IRC_WriteStrClient(from,
+ if (SendErrors && !IRC_WriteErrClient(from,
ERR_NONONREG_MSG,
Client_ID(from), Client_ID(cl)))
return DISCONNECTED;
cl2chan = Channel_NextChannelOf(cl, cl2chan);
}
if (!cl2chan) {
- if (SendErrors && !IRC_WriteStrClient(
+ if (SendErrors && !IRC_WriteErrClient(
from, ERR_NOTONSAMECHANNEL_MSG,
Client_ID(from), Client_ID(cl)))
return DISCONNECTED;
}
if (SendErrors && (Client_Type(Client) != CLIENT_SERVER)
- && strchr(Client_Modes(cl), 'a')) {
+ && Client_HasMode(cl, 'a')) {
/* Target is away */
if (!IRC_WriteStrClient(from, RPL_AWAY_MSG,
Client_ID(from),
} else {
if (!SendErrors)
return CONNECTED;
- if (!IRC_WriteStrClient(from, ERR_NOSUCHNICK_MSG,
+ if (!IRC_WriteErrClient(from, ERR_NOSUCHNICK_MSG,
Client_ID(from), currentTarget))
return DISCONNECTED;
}
cl = NULL;
- if (strchr(Client_Modes(from), 'o') == NULL) {
+ if (!Client_HasMode(from, 'o')) {
if (!SendErrors)
return true;
- return IRC_WriteStrClient(from, ERR_NOPRIVILEGES_MSG,
+ return IRC_WriteErrClient(from, ERR_NOPRIVILEGES_MSG,
Client_ID(from));
}
{
if (!SendErrors)
return true;
- return IRC_WriteStrClient(from, ERR_WILDTOPLEVEL, targetMask);
+ return IRC_WriteErrClient(from, ERR_WILDTOPLEVEL, targetMask);
}
/* #: hostmask, see RFC 2812, sec. 3.3.1 */