]> jfr.im git - solanum.git/blobdiff - modules/core/m_join.c
m_quit: add desc string
[solanum.git] / modules / core / m_join.c
index b18921413bf5b563e616139bfc19662d6c90445f..966352b7f4ba5f97ba295038485183db625cc6a6 100644 (file)
@@ -20,8 +20,6 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
- *
- *  $Id: m_join.c 3494 2007-05-27 13:07:27Z jilles $
  */
 
 #include "stdinc.h"
 #include "ratelimit.h"
 #include "s_assert.h"
 
-static int m_join(struct Client *, struct Client *, int, const char **);
-static int ms_join(struct Client *, struct Client *, int, const char **);
-static int ms_sjoin(struct Client *, struct Client *, int, const char **);
+static int m_join(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int ms_join(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int ms_sjoin(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static const char join_desc[] = "Provides the JOIN and TS6 SJOIN commands to facilitate joining and creating channels";
 
 static int h_can_create_channel;
 static int h_channel_join;
 
 struct Message join_msgtab = {
-       "JOIN", 0, 0, 0, MFLG_SLOW,
+       "JOIN", 0, 0, 0, 0,
        {mg_unreg, {m_join, 2}, {ms_join, 2}, mg_ignore, mg_ignore, {m_join, 2}}
 };
 
 struct Message sjoin_msgtab = {
-       "SJOIN", 0, 0, 0, MFLG_SLOW,
+       "SJOIN", 0, 0, 0, 0,
        {mg_unreg, mg_ignore, mg_ignore, {ms_sjoin, 4}, mg_ignore, mg_ignore}
 };
 
@@ -69,7 +68,7 @@ mapi_hlist_av1 join_hlist[] = {
        { NULL, NULL },
 };
 
-DECLARE_MODULE_AV1(join, NULL, NULL, join_clist, join_hlist, NULL, "$Revision: 3494 $");
+DECLARE_MODULE_AV2(join, NULL, NULL, join_clist, join_hlist, NULL, NULL, NULL, join_desc);
 
 static void do_join_0(struct Client *client_p, struct Client *source_p);
 static int check_channel_name_loc(struct Client *source_p, const char *name);
@@ -139,7 +138,7 @@ check_forward(struct Client *source_p, struct Channel *chptr,
  *      parv[2] = channel password (key)
  */
 static int
-m_join(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+m_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        static char jbuf[BUFSIZE];
        struct Channel *chptr = NULL, *chptr2 = NULL;
@@ -278,9 +277,9 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
 
                if((rb_dlink_list_length(&source_p->user->channel) >=
                    (unsigned long) ConfigChannel.max_chans_per_user) &&
-                  (!IsOper(source_p) ||
+                  (!IsExtendChans(source_p) ||
                    (rb_dlink_list_length(&source_p->user->channel) >=
-                    (unsigned long) ConfigChannel.max_chans_per_user * 3)))
+                    (unsigned long) ConfigChannel.max_chans_per_user_large)))
                {
                        sendto_one(source_p, form_str(ERR_TOOMANYCHANNELS),
                                   me.name, source_p->name, name);
@@ -341,8 +340,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",
@@ -393,7 +391,7 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
  * alternatively, a single "0" parameter parts all channels
  */
 static int
-ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+ms_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct Channel *chptr;
        static struct Mode mode;
@@ -513,7 +511,7 @@ ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *
 }
 
 static int
-ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+ms_sjoin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        static char buf_uid[BUFSIZE];
        static const char empty_modes[] = "0";
@@ -770,7 +768,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
        else
                modes = empty_modes;
 
-       mlen_uid = rb_sprintf(buf_uid, ":%s SJOIN %ld %s %s :",
+       mlen_uid = sprintf(buf_uid, ":%s SJOIN %ld %s %s :",
                              use_id(source_p), (long) chptr->channelts, parv[2], modes);
        ptr_uid = buf_uid + mlen_uid;
 
@@ -839,7 +837,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
                }
 
                /* copy the nick to the two buffers */
-               len = rb_sprintf(ptr_uid, "%s ", use_id(target_p));
+               len = sprintf(ptr_uid, "%s ", use_id(target_p));
                ptr_uid += len;
                len_uid += len;
 
@@ -1110,7 +1108,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                        dir = MODE_DEL;
                }
                *mbuf++ = 'k';
-               len = rb_sprintf(pbuf, "%s ", oldmode->key);
+               len = sprintf(pbuf, "%s ", oldmode->key);
                pbuf += len;
        }
        if(oldmode->join_num && !mode->join_num)
@@ -1139,7 +1137,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                        dir = MODE_ADD;
                }
                *mbuf++ = 'l';
-               len = rb_sprintf(pbuf, "%d ", mode->limit);
+               len = sprintf(pbuf, "%d ", mode->limit);
                pbuf += len;
        }
        if(mode->key[0] && strcmp(oldmode->key, mode->key))
@@ -1150,7 +1148,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                        dir = MODE_ADD;
                }
                *mbuf++ = 'k';
-               len = rb_sprintf(pbuf, "%s ", mode->key);
+               len = sprintf(pbuf, "%s ", mode->key);
                pbuf += len;
        }
        if(mode->join_num && (oldmode->join_num != mode->join_num || oldmode->join_time != mode->join_time))
@@ -1161,7 +1159,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                        dir = MODE_ADD;
                }
                *mbuf++ = 'j';
-               len = rb_sprintf(pbuf, "%d:%d ", mode->join_num, mode->join_time);
+               len = sprintf(pbuf, "%d:%d ", mode->join_num, mode->join_time);
                pbuf += len;
        }
        if(mode->forward[0] && strcmp(oldmode->forward, mode->forward) &&
@@ -1173,7 +1171,7 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
                        dir = MODE_ADD;
                }
                *mbuf++ = 'f';
-               len = rb_sprintf(pbuf, "%s ", mode->forward);
+               len = sprintf(pbuf, "%s ", mode->forward);
                pbuf += len;
        }
        *mbuf = '\0';
@@ -1298,7 +1296,7 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p,
 
        pbuf = lparabuf;
 
-       cur_len = mlen = rb_sprintf(lmodebuf, ":%s MODE %s -", source_p->name, chptr->chname);
+       cur_len = mlen = sprintf(lmodebuf, ":%s MODE %s -", source_p->name, chptr->chname);
        mbuf = lmodebuf + mlen;
 
        RB_DLINK_FOREACH_SAFE(ptr, next_ptr, list->head)
@@ -1326,9 +1324,9 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p,
                *mbuf++ = c;
                cur_len += plen;
                if (banptr->forward)
-                       pbuf += rb_sprintf(pbuf, "%s$%s ", banptr->banstr, banptr->forward);
+                       pbuf += sprintf(pbuf, "%s$%s ", banptr->banstr, banptr->forward);
                else
-                       pbuf += rb_sprintf(pbuf, "%s ", banptr->banstr);
+                       pbuf += sprintf(pbuf, "%s ", banptr->banstr);
                count++;
 
                free_ban(banptr);