added Channel Mode +S (SSL): Only allow SSL Users joining the channel
[ircu2.10.12-pk.git] / ircd / m_relay.c
index fc8e1cd4ce4bb356eefa65d36b1a4e2c91563c28..2bfb142da4b69c3c3180c94b75f57c3e5b51d98b 100644 (file)
@@ -39,9 +39,9 @@ static void loc_handler_LR(const char *num, char *parv[], signed int parc) {
 static void loc_handler_LA(const char *num, char *parv[], signed int parc) {
     if(num[0] != '!' || parc < 1) return;
        char *fakehost = NULL;
-       if (parc > 1 && parv[1] != "0")
+       if (parc > 1 && strcmp(parv[1], "0") != 0) // 0 = no fakehost
                fakehost=parv[1];
-               
+
     if(parc > 2)
         auth_loc_reply(&num[3], parv[0], fakehost, &parv[2] , parc - 2);
     else if(parc > 1)
@@ -105,6 +105,8 @@ static void mode_a_check_altchan(struct Client* sptr, char *channel) {
         err2 = ERR_CHANNELISFULL;
       else if ((chptrb->mode.mode & MODE_REGONLY) && !IsAccount(sptr))
         err2 = ERR_NEEDREGGEDNICK;
+      else if ((chptrb->mode.mode & MODE_SSLCHAN) && !IsSSL(sptr))
+        err2 = ERR_SSLCHANNEL;
       else if (find_ban(sptr, chptrb->banlist))
         err2 = ERR_BANNEDFROMCHAN;
       else if (*chptrb->mode.key) //Fix this!
@@ -230,11 +232,12 @@ signed int ms_relay(struct Client* cptr, struct Client* sptr, signed int parc, c
         struct Client *acptr;
         struct Channel *chptr;
         if(acptr = findNUser(parv[1])) {
-         if(chptr = FindChannel(parv[3]) && chptr->mode.altchan && 
+         if(IsChannelName(parv[3]) && strIsIrcCh(parv[3]) && 
+         (chptr = FindChannel(parv[3])) && chptr->mode.altchan && 
             IsChannelName(chptr->mode.altchan) && strIsIrcCh(chptr->mode.altchan)) {
        mode_a_check_altchan(acptr,chptr->mode.altchan);
          }
-         send_reply(acptr, ERR_JOINACCESS, parv[3]);
+         send_reply(acptr, ERR_JOINACCESS, parv[3], feature_str(FEAT_ERR_JOINACCESS));
         }
        }