X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-op.c;h=2bf9e349b36245dced9ee4485acb43a8b2f1fef7;hb=HEAD;hp=82a78ebf7d712675497a3f5314514aa420620b6f;hpb=a13bb78b1e7adf7c261ac427341c397ef9a6a1ed;p=ngircd-alex.git diff --git a/src/ngircd/irc-op.c b/src/ngircd/irc-op.c index 82a78ebf..2bf9e349 100644 --- a/src/ngircd/irc-op.c +++ b/src/ngircd/irc-op.c @@ -28,6 +28,8 @@ #include "messages.h" #include "parse.h" +#include "irc-op.h" + /* Local functions */ static bool @@ -148,6 +150,14 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) return IRC_WriteErrClient(from, ERR_NOSUCHNICK_MSG, Client_ID(Client), Req->argv[0]); + if (Req->argv[1][0] == '&') { + /* Local channel. Make sure the target user is on this server! */ + if (Client_Conn(target) == NONE) + return IRC_WriteErrClient(from, ERR_USERNOTONSERV_MSG, + Client_ID(Client), + Req->argv[0]); + } + chan = Channel_Search(Req->argv[1]); if (chan) { /* Channel exists. Is the user a valid member of the channel? */ @@ -190,7 +200,7 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) if (remember) { /* We must remember this invite */ if (!Channel_AddInvite(chan, Client_MaskCloaked(target), - true)) + true, Client_ID(from))) return CONNECTED; } } @@ -212,9 +222,9 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) if (Client_Conn(target) > NONE) { /* The target user is local, so we have to send the status code */ - if (!IRC_WriteStrClientPrefix(from, target, RPL_INVITING_MSG, - Client_ID(from), Req->argv[0], - colon_if_necessary, Req->argv[1])) + if (!IRC_WriteStrClient(from, RPL_INVITING_MSG, + Client_ID(from), Req->argv[0], + colon_if_necessary, Req->argv[1])) return DISCONNECTED; if (Client_HasMode(target, 'a') &&