* 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}
};
{ 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);
* 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;
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);
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",
* 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;
}
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";
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;
}
/* 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;
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)
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))
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))
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) &&
dir = MODE_ADD;
}
*mbuf++ = 'f';
- len = rb_sprintf(pbuf, "%s ", mode->forward);
+ len = sprintf(pbuf, "%s ", mode->forward);
pbuf += len;
}
*mbuf = '\0';
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)
*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);