part 2: don't forward users if they are already in the target channel (same fix like...
[ircu2.10.12-pk.git] / ircd / m_relay.c
index ed8a758d117b43af398f0a7af53a9af09b6412d4..9996719bc6fd97b7c5ff66db764870928bfbdc09 100644 (file)
@@ -90,6 +90,8 @@ static void mode_a_check_altchan(struct Client* sptr, char *channel) {
                joinbuf_flush(&create);
          }
        } else {
+      if(find_member_link(chptrb, sptr))
+        return; //we have already joined this channel
          //first of all check if we may even join this channel
          int err2 = 0;
          int flags = 0;
@@ -105,6 +107,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!