X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-op.c;h=5c12faf78022ac8929d239029a4e7d2e8ff2fe47;hb=3e47bc9af511716bbe388f0a29b5fdbb617cee4c;hp=6cd01049b88e284743289a88308dc786077d4560;hpb=f92a614a35699f5192b8ea85a5844c3bf57ec0b6;p=ngircd-alex.git diff --git a/src/ngircd/irc-op.c b/src/ngircd/irc-op.c index 6cd01049..5c12faf7 100644 --- a/src/ngircd/irc-op.c +++ b/src/ngircd/irc-op.c @@ -7,13 +7,15 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. - * - * Channel operator commands */ - #include "portab.h" +/** + * @file + * Channel operator commands + */ + #include "imp.h" #include #include @@ -21,7 +23,6 @@ #include "defines.h" #include "conn.h" -#include "client.h" #include "channel.h" #include "irc-write.h" #include "lists.h" @@ -163,10 +164,18 @@ 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 operator! */ - if (!strchr(Channel_UserModes(chan, from), 'o')) + /* Yes. The user must be channel owner/admin/operator/halfop! */ + if (!strchr(Channel_UserModes(chan, from), 'q') && + !strchr(Channel_UserModes(chan, from), 'a') && + !strchr(Channel_UserModes(chan, from), 'o') && + !strchr(Channel_UserModes(chan, from), 'h')) return IRC_WriteStrClient(from, ERR_CHANOPRIVSNEEDED_MSG, Client_ID(from), Channel_Name(chan)); remember = true;