]> arthur.barton.de Git - ngircd.git/commitdiff
Merge branch 'recognize-umode-R'
authorAlexander Barton <alex@barton.de>
Mon, 27 Aug 2012 21:21:28 +0000 (23:21 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 27 Aug 2012 21:21:28 +0000 (23:21 +0200)
By Alexander Barton (1) and DNS777 (1)

* recognize-umode-R:
  Only allow IRC services to modify user mode "R"
  Recognize user mode "R"

src/ngircd/irc-mode.c
src/ngircd/messages.h

index f91a28c6aca634591e785a41b2f159d6b4629e52..8da4a65aefed06ed1f41f0b0de43c9fc348201cd 100644 (file)
@@ -256,6 +256,14 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
                                                        ERR_RESTRICTED_MSG,
                                                        Client_ID(Origin));
                        break;
+               case 'R': /* Registered (not [un]settable by clients) */
+                       if (Client_Type(Client) == CLIENT_SERVER)
+                               x[0] = 'R';
+                       else
+                               ok = IRC_WriteStrClient(Origin,
+                                                       ERR_NICKREGISTER_MSG,
+                                                       Client_ID(Origin));
+                       break;
                case 'x': /* Cloak hostname */
                        if (Client_HasMode(Client, 'r'))
                                ok = IRC_WriteStrClient(Origin,
index 53637b446357a97d0a1a32d104f6355a78f4b5ef..da861f9a8b45f8743f87575c912101de251daef4 100644 (file)
 #define ERR_CHANOPRIVSNEEDED_MSG       "482 %s %s :You are not channel operator"
 #define ERR_CANTKILLSERVER_MSG         "483 %s :You can't kill a server!"
 #define ERR_RESTRICTED_MSG             "484 %s :Your connection is restricted"
+#define ERR_NICKREGISTER_MSG           "484 %s :Cannot modify user mode (+R) -- Use IRC services"
 #define ERR_NOOPERHOST_MSG             "491 %s :Not configured for your host"
 #define ERR_NOTONSAMECHANNEL_MSG       "493 %s :You must share a common channel with %s"