]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/core/m_join.c
ENCAPs cannot come from local clients, no need to check.
[irc/rqf/shadowircd.git] / modules / core / m_join.c
index 6f28e13966cd2fcc3e4d7537d22bc31e35e36fd8..f8598d7d10898429c9ef4f4fa98f32b53d7fdf35 100644 (file)
@@ -125,7 +125,6 @@ check_forward(struct Client *source_p, struct Channel *chptr,
 
 /*
  * m_join
- *      parv[0] = sender prefix
  *      parv[1] = channel
  *      parv[2] = channel password (key)
  */
@@ -388,7 +387,6 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
 
 /*
  * ms_join
- *      parv[0] = sender prefix
  *      parv[1] = channel TS
  *      parv[2] = channel
  *      parv[3] = "+", formerly channel modes but now unused
@@ -992,27 +990,36 @@ do_join_0(struct Client *client_p, struct Client *source_p)
 static int
 check_channel_name_loc(struct Client *source_p, const char *name)
 {
+       const char *p;
+
        s_assert(name != NULL);
        if(EmptyString(name))
                return 0;
 
        if(ConfigFileEntry.disable_fake_channels && !IsOper(source_p))
        {
-               for(; *name; ++name)
+               for(p = name; *p; ++p)
                {
-                       if(!IsChanChar(*name) || IsFakeChanChar(*name))
+                       if(!IsChanChar(*p) || IsFakeChanChar(*p))
                                return 0;
                }
        }
        else
        {
-               for(; *name; ++name)
+               for(p = name; *p; ++p)
                {
-                       if(!IsChanChar(*name))
+                       if(!IsChanChar(*p))
                                return 0;
                }
        }
 
+       if(ConfigChannel.only_ascii_channels)
+       {
+               for(p = name; *p; ++p)
+                       if(*p < 33 || *p > 126)
+                               return 0;
+       }
+
        return 1;
 }