]> jfr.im git - solanum.git/blobdiff - modules/core/m_join.c
implement configurable channel modes (closes #31)
[solanum.git] / modules / core / m_join.c
index e8db2d7c315c985ff0ad113ac8e6d8d85802c11c..b45728e3b97565bdfa349e39cd55519325460f2f 100644 (file)
@@ -341,8 +341,7 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
                if(flags & CHFL_CHANOP)
                {
                        chptr->channelts = rb_current_time();
-                       chptr->mode.mode |= MODE_TOPICLIMIT;
-                       chptr->mode.mode |= MODE_NOPRIVMSGS;
+                       chptr->mode.mode |= ConfigChannel.autochanmodes;
                        modes = channel_modes(chptr, &me);
 
                        sendto_channel_local(ONLY_CHANOPS, chptr, ":%s MODE %s %s",
@@ -529,7 +528,6 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
        int fl;
        int isnew;
        int mlen_uid;
-       int len_nick;
        int len_uid;
        int len;
        int joins = 0;
@@ -540,6 +538,9 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
        static char empty[] = "";
        rb_dlink_node *ptr, *next_ptr;
 
+       if(parc < 5)
+               return 0;
+
        if(!IsChannelName(parv[2]) || !check_channel_name(parv[2]))
                return 0;
 
@@ -640,7 +641,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
 
        if(isnew)
                chptr->channelts = newts;
-       
+
        else if(newts == 0 || oldts == 0)
                chptr->channelts = 0;
        else if(newts == oldts)
@@ -775,7 +776,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
        mbuf = modebuf;
        para[0] = para[1] = para[2] = para[3] = empty;
        pargs = 0;
-       len_nick = len_uid = 0;
+       len_uid = 0;
 
        /* if theres a space, theres going to be more than one nick, change the
         * first space to \0, so s is just the first nick, and point p to the
@@ -827,13 +828,11 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
                        if(fl & CHFL_CHANOP)
                        {
                                *ptr_uid++ = '@';
-                               len_nick++;
                                len_uid++;
                        }
                        if(fl & CHFL_VOICE)
                        {
                                *ptr_uid++ = '+';
-                               len_nick++;
                                len_uid++;
                        }
                }
@@ -1183,8 +1182,8 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
  * remove_our_modes
  *
  * inputs      -
- * output      - 
- * side effects        - 
+ * output      -
+ * side effects        -
  */
 static void
 remove_our_modes(struct Channel *chptr, struct Client *source_p)