]> arthur.barton.de Git - ngircd-alex.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"

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

diff --combined src/ngircd/irc-mode.c
index f91a28c6aca634591e785a41b2f159d6b4629e52,ca4cdd0624f6db851d7fdd2e0920612835066a2f..8da4a65aefed06ed1f41f0b0de43c9fc348201cd
@@@ -256,6 -256,14 +256,14 @@@ Client_Mode( CLIENT *Client, REQUEST *R
                                                        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,
@@@ -500,7 -508,6 +508,7 @@@ Channel_Mode(CLIENT *Client, REQUEST *R
                switch (*mode_ptr) {
                /* --- Channel modes --- */
                case 'i': /* Invite only */
 +              case 'M': /* Only identified nicks can write */
                case 'm': /* Moderated */
                case 'n': /* Only members can write */
                case 'R': /* Registered users only */
diff --combined src/ngircd/messages.h
index 53637b446357a97d0a1a32d104f6355a78f4b5ef,82cc30fe03250ce7186fc082968cad37fc9fdae0..da861f9a8b45f8743f87575c912101de251daef4
@@@ -21,7 -21,7 +21,7 @@@
  #define RPL_YOURHOST_MSG              "002 %s :Your host is %s, running version ngircd-%s (%s/%s/%s)"
  #define RPL_CREATED_MSG                       "003 %s :This server has been started %s"
  #define RPL_MYINFO_MSG                        "004 %s %s ngircd-%s %s %s"
 -#define RPL_ISUPPORT1_MSG             "005 %s RFC2812 IRCD=ngIRCd CASEMAPPING=ascii PREFIX=(ov)@+ CHANTYPES=#&+ CHANMODES=beI,k,l,imnOPRstz CHANLIMIT=#&+:%d :are supported on this server"
 +#define RPL_ISUPPORT1_MSG             "005 %s RFC2812 IRCD=ngIRCd CASEMAPPING=ascii PREFIX=(ov)@+ CHANTYPES=#&+ CHANMODES=beI,k,l,imMnOPRstz CHANLIMIT=#&+:%d :are supported on this server"
  #define RPL_ISUPPORT2_MSG             "005 %s CHANNELLEN=%d NICKLEN=%d TOPICLEN=%d AWAYLEN=%d KICKLEN=%d MODES=%d MAXLIST=beI:%d EXCEPTS=e INVEX=I PENALTY :are supported on this server"
  
  #define RPL_TRACELINK_MSG             "200 %s Link %s-%s %s %s V%s %ld %d %d"
@@@ -99,7 -99,7 +99,7 @@@
  #define ERR_NOSUCHNICK_MSG            "401 %s %s :No such nick or channel name"
  #define ERR_NOSUCHSERVER_MSG          "402 %s %s :No such server"
  #define ERR_NOSUCHCHANNEL_MSG         "403 %s %s :No such channel"
 -#define ERR_CANNOTSENDTOCHAN_MSG      "404 %s %s :Cannot send to channel"
 +#define ERR_CANNOTSENDTOCHAN_MSG      "404 %s %s :Cannot send to channel (+m) -- Moderated"
  #define ERR_TOOMANYCHANNELS_MSG               "405 %s %s :You have joined too many channels"
  #define ERR_WASNOSUCHNICK_MSG         "406 %s %s :There was no such nickname"
  #define ERR_NOORIGIN_MSG              "409 %s :No origin specified"
  #define ERR_NEEDMOREPARAMS_MSG                "461 %s %s :Syntax error"
  #define ERR_ALREADYREGISTRED_MSG      "462 %s :Connection already registered"
  #define ERR_PASSWDMISMATCH_MSG                "464 %s :Invalid password"
 -#define ERR_CHANNELISFULL_MSG         "471 %s %s :Cannot join channel (+l)"
 -#define ERR_SECURECHANNEL_MSG         "471 %s %s :Cannot join channel (+z)"
 -#define ERR_OPONLYCHANNEL_MSG         "471 %s %s :Cannot join channel (+O)"
 -#define ERR_REGONLYCHANNEL_MSG                "471 %s %s :Cannot join channel (+R)"
 +#define ERR_CHANNELISFULL_MSG         "471 %s %s :Cannot join channel (+l) -- Channel is too full, try later"
 +#define ERR_SECURECHANNEL_MSG         "471 %s %s :Cannot join channel (+z) -- SSL connections only"
 +#define ERR_OPONLYCHANNEL_MSG         "471 %s %s :Cannot join channel (+O) -- IRC opers only"
 +#define ERR_REGONLYCHANNEL_MSG                "471 %s %s :Cannot join channel (+R) -- Registered users only"
  #define ERR_UNKNOWNMODE_MSG           "472 %s %c :is unknown mode char for %s"
 -#define ERR_INVITEONLYCHAN_MSG                "473 %s %s :Cannot join channel (+i)"
 -#define ERR_BANNEDFROMCHAN_MSG                "474 %s %s :Cannot join channel (+b)"
 -#define ERR_BADCHANNELKEY_MSG         "475 %s %s :Cannot join channel (+k)"
 +#define ERR_INVITEONLYCHAN_MSG                "473 %s %s :Cannot join channel (+i) -- Invited users only"
 +#define ERR_BANNEDFROMCHAN_MSG                "474 %s %s :Cannot join channel (+b) -- You are banned"
 +#define ERR_BADCHANNELKEY_MSG         "475 %s %s :Cannot join channel (+k) -- Wrong channel key"
  #define ERR_NOCHANMODES_MSG           "477 %s %s :Channel doesn't support modes"
  #define ERR_LISTFULL_MSG              "478 %s %s %s: Channel list is full (%d)"
  #define ERR_NOPRIVILEGES_MSG          "481 %s :Permission denied"
  #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"