]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-op.c
Make sure that the target user is able to join a local channel
[ngircd-alex.git] / src / ngircd / irc-op.c
index 82a78ebf7d712675497a3f5314514aa420620b6f..2e5c680aaa52ddde65b6a0ade839e90e96770cdb 100644 (file)
@@ -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? */