]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-channel.c
ISON command: reply with correct upper-/lowercase nick names
[ngircd-alex.git] / src / ngircd / irc-channel.c
index 33ea68d309ffc84cfbedb91518f817c61e171bb3..cc70eb47d5d25e77bdf170e8117828ec8e92a6f1 100644 (file)
@@ -137,6 +137,13 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame,
                return false;
        }
 
+       if (strchr(channel_modes, 'R') && !strchr(Client_Modes(Client), 'R')) {
+               /* Only registered users are allowed! */
+               IRC_WriteStrClient(Client, ERR_REGONLYCHANNEL_MSG,
+                                  Client_ID(Client), channame);
+               return false;
+       }
+
        return true;
 } /* join_allowed */
 
@@ -237,7 +244,7 @@ join_forward(CLIENT *Client, CLIENT *target, CHANNEL *chan,
        IRC_WriteStrChannelPrefix(Client, chan, target, false,
                                  "JOIN :%s",  channame);
 
-       /* syncronize channel modes */
+       /* synchronize channel modes */
        if (modes[1]) {
                IRC_WriteStrChannelPrefix(Client, chan, target, false,
                                          "MODE %s +%s %s", channame,
@@ -526,6 +533,8 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req )
                                               Client_ID(Client),
                                               Channel_Name(chan), topic);
 #ifndef STRICT_RFC
+                       if (!r)
+                               return r;
                        r = IRC_WriteStrClient(from, RPL_TOPICSETBY_MSG,
                                               Client_ID(Client),
                                               Channel_Name(chan),
@@ -688,7 +697,9 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
        assert( Req != NULL );
 
        /* Bad number of parameters? */
-       if(( Req->argc < 2 ) || ( Req->argc == 4 ) || ( Req->argc > 5 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+       if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5)
+               return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+                                         Client_ID(Client), Req->command);
 
        /* Compatibility kludge */
        if( Req->argc == 5 ) arg_topic = 4;