static char *
-Option_String( CONN_ID Idx )
+#ifdef ZLIB
+Option_String(CONN_ID Idx)
+#else
+Option_String(UNUSED CONN_ID Idx)
+#endif
{
static char option_txt[8];
+#ifdef ZLIB
UINT16 options;
options = Conn_Options(Idx);
+#endif
strcpy(option_txt, "F"); /* No idea what this means, but the
* original ircd sends it ... */
Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
{
CLIENT *cl, *from;
+ CL2CHAN *cl2chan;
CHANNEL *chan;
char *currentTarget = Req->argv[0];
char *lastCurrentTarget = NULL;
Client_Type(cl) != CLIENT_SERVICE)
continue;
if (nick != NULL && host != NULL) {
- if (strcmp(nick, Client_ID(cl)) == 0 &&
- strcmp(user, Client_User(cl)) == 0 &&
+ if (strcasecmp(nick, Client_ID(cl)) == 0 &&
+ strcasecmp(user, Client_User(cl)) == 0 &&
strcasecmp(host, Client_HostnameCloaked(cl)) == 0)
break;
else
#else
if (Client_Type(cl) != ForceType) {
#endif
- if (!SendErrors)
- return CONNECTED;
- return IRC_WriteStrClient(from, ERR_NOSUCHNICK_MSG,
- Client_ID(from),
- currentTarget);
+ if (SendErrors && !IRC_WriteStrClient(
+ from, ERR_NOSUCHNICK_MSG,Client_ID(from),
+ currentTarget))
+ return DISCONNECTED;
+ goto send_next_target;
}
#ifndef STRICT_RFC
}
#endif
+ if (Client_HasMode(cl, 'C')) {
+ cl2chan = Channel_FirstChannelOf(cl);
+ while (cl2chan) {
+ chan = Channel_GetChannel(cl2chan);
+ if (Channel_IsMemberOf(chan, from))
+ break;
+ cl2chan = Channel_NextChannelOf(cl, cl2chan);
+ }
+ if (!cl2chan) {
+ if (SendErrors && !IRC_WriteStrClient(
+ from, ERR_NOTONSAMECHANNEL_MSG,
+ Client_ID(from), Client_ID(cl)))
+ return DISCONNECTED;
+ goto send_next_target;
+ }
+ }
+
if (SendErrors && (Client_Type(Client) != CLIENT_SERVER)
&& strchr(Client_Modes(cl), 'a')) {
/* Target is away */
return DISCONNECTED;
}
+ send_next_target:
currentTarget = strtok_r(NULL, ",", &lastCurrentTarget);
if (currentTarget)
Conn_SetPenalty(Client_Conn(Client), 1);