X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-op.c;h=0297015a8758e9075b608a95e17502fe6e391540;hb=a53de63ba7fcb4144f4fcc2db221556177528900;hp=08495475f60520c7dd899d7cef9e10b4f4852550;hpb=e3e181f4b3eae0e552632bce19bdff990196938f;p=ngircd-alex.git diff --git a/src/ngircd/irc-op.c b/src/ngircd/irc-op.c index 08495475..0297015a 100644 --- a/src/ngircd/irc-op.c +++ b/src/ngircd/irc-op.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2005 by Alexander Barton (alex@barton.de) + * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ #include "exp.h" #include "irc-op.h" +/* Local functions */ static bool try_kick(CLIENT *peer, CLIENT* from, const char *nick, const char *channel, @@ -47,7 +48,15 @@ try_kick(CLIENT *peer, CLIENT* from, const char *nick, const char *channel, return true; } +/* Global functions */ +/** + * Handler for the IRC command "KICK". + * + * @param Client The client from which this command has been received. + * @param Req Request structure with prefix and all parameters. + * @return CONNECTED or DISCONNECTED. + */ GLOBAL bool IRC_KICK(CLIENT *Client, REQUEST *Req) { @@ -128,7 +137,13 @@ IRC_KICK(CLIENT *Client, REQUEST *Req) return true; } /* IRC_KICK */ - +/** + * Handler for the IRC command "INVITE". + * + * @param Client The client from which this command has been received. + * @param Req Request structure with prefix and all parameters. + * @return CONNECTED or DISCONNECTED. + */ GLOBAL bool IRC_INVITE(CLIENT *Client, REQUEST *Req) { @@ -164,6 +179,11 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) if (!Channel_IsMemberOf(chan, from)) return IRC_WriteStrClient(from, ERR_NOTONCHANNEL_MSG, Client_ID(Client), Req->argv[1]); + /* Is the channel "invite-disallow"? */ + if (strchr(Channel_Modes(chan), 'V')) + return IRC_WriteStrClient(from, ERR_NOINVITE_MSG, + Client_ID(from), Channel_Name(chan)); + /* Is the channel "invite-only"? */ if (strchr(Channel_Modes(chan), 'i')) { /* Yes. The user must be channel owner/admin/operator/halfop! */ @@ -192,8 +212,8 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) } } - LogDebug("User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask(from), Req->argv[0], Req->argv[1]); - + LogDebug("User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask(from), + Req->argv[0], Req->argv[1]); /* * RFC 2812 says: @@ -221,5 +241,4 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) return CONNECTED; } /* IRC_INVITE */ - /* -eof- */