]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-op.c
PredefChannelsOnly: Fix message for non pre-defined channels
[ngircd-alex.git] / src / ngircd / irc-op.c
index 34b0eb0f8e1fea9e00a0087947088b0978a3711e..5c12faf78022ac8929d239029a4e7d2e8ff2fe47 100644 (file)
@@ -9,7 +9,6 @@
  * Please read the file COPYING, README and AUTHORS for more information.
  */
 
-
 #include "portab.h"
 
 /**
@@ -165,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;