#include "client.h"
#include "common.h"
#include "hash.h"
-#include "irc_string.h"
+#include "match.h"
#include "ircd.h"
#include "numeric.h"
#include "send.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
-#include "sprintf_irc.h"
#include "packet.h"
static int m_join(struct Client *, struct Client *, int, const char **);
struct Message sjoin_msgtab = {
"SJOIN", 0, 0, 0, MFLG_SLOW,
- {mg_unreg, mg_ignore, mg_ignore, {ms_sjoin, 0}, mg_ignore, mg_ignore}
+ {mg_unreg, mg_ignore, mg_ignore, {ms_sjoin, 4}, mg_ignore, mg_ignore}
};
mapi_clist_av1 join_clist[] = { &join_msgtab, &sjoin_msgtab, NULL };
* this code has a side effect of losing keys, but..
*/
chanlist = LOCAL_COPY(parv[1]);
- for(name = strtoken(&p, chanlist, ","); name; name = strtoken(&p, NULL, ","))
+ for(name = rb_strtok_r(chanlist, ",", &p); name; name = rb_strtok_r(NULL, ",", &p))
{
/* check the length and name of channel is ok */
if(!check_channel_name_loc(source_p, name) || (strlen(name) > LOC_CHANNELLEN))
if(parc > 2)
{
mykey = LOCAL_COPY(parv[2]);
- key = strtoken(&p2, mykey, ",");
+ key = rb_strtok_r(mykey, ",", &p2);
}
- for(name = strtoken(&p, jbuf, ","); name;
- key = (key) ? strtoken(&p2, NULL, ",") : NULL, name = strtoken(&p, NULL, ","))
+ for(name = rb_strtok_r(jbuf, ",", &p); name;
+ key = (key) ? rb_strtok_r(NULL, ",", &p2) : NULL, name = rb_strtok_r(NULL, ",", &p))
{
hook_data_channel_activity hook_info;
":%s SJOIN %ld %s +nt :@%s",
me.id, (long) chptr->channelts,
chptr->chname, source_p->id);
- sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
- ":%s SJOIN %ld %s +nt :@%s",
- me.name, (long) chptr->channelts,
- chptr->chname, source_p->name);
}
}
else
":%s JOIN %ld %s +",
use_id(source_p), (long) chptr->channelts,
chptr->chname);
-
- sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
- ":%s SJOIN %ld %s + :%s",
- me.name, (long) chptr->channelts,
- chptr->chname, source_p->name);
}
del_invite(chptr, source_p);
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s JOIN %ld %s +",
source_p->id, (long) chptr->channelts, chptr->chname);
- sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
- ":%s SJOIN %ld %s %s :%s",
- source_p->servptr->name, (long) chptr->channelts,
- chptr->chname, keep_new_modes ? "+" : "0",
- source_p->name);
return 0;
}
static int
ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
- static char buf_nick[BUFSIZE];
static char buf_uid[BUFSIZE];
static const char empty_modes[] = "0";
struct Channel *chptr;
int keep_new_modes = 1;
int fl;
int isnew;
- int mlen_nick, mlen_uid;
+ int mlen_uid;
int len_nick;
int len_uid;
int len;
int joins = 0;
const char *s;
- char *ptr_nick;
char *ptr_uid;
char *p;
int i, joinc = 0, timeslice = 0;
":%s KICK %s %s :Net Rider",
me.id, chptr->chname,
who->id);
- sendto_server(NULL, chptr, NOCAPS, CAP_TS6,
- ":%s KICK %s %s :Net Rider",
- me.name, chptr->chname, who->name);
remove_user_from_channel(msptr);
if (--l == 0)
break;
else
modes = empty_modes;
- mlen_nick = rb_sprintf(buf_nick, ":%s SJOIN %ld %s %s :",
- source_p->name, (long) chptr->channelts, parv[2], modes);
- ptr_nick = buf_nick + mlen_nick;
-
/* working on the presumption eventually itll be more efficient to
* build a TS6 buffer without checking its needed..
*/
/* we assume for these we can fit at least one nick/uid in.. */
/* check we can fit another status+nick+space into a buffer */
- if((mlen_nick + len_nick + NICKLEN + 3) > (BUFSIZE - 3))
- {
- *(ptr_nick - 1) = '\0';
- sendto_server(client_p->from, NULL, NOCAPS, CAP_TS6, "%s", buf_nick);
- ptr_nick = buf_nick + mlen_nick;
- len_nick = 0;
- }
-
if((mlen_uid + len_uid + IDLEN + 3) > (BUFSIZE - 3))
{
*(ptr_uid - 1) = '\0';
{
if(fl & CHFL_CHANOP)
{
- *ptr_nick++ = '@';
*ptr_uid++ = '@';
len_nick++;
len_uid++;
}
if(fl & CHFL_VOICE)
{
- *ptr_nick++ = '+';
*ptr_uid++ = '+';
len_nick++;
len_uid++;
}
/* copy the nick to the two buffers */
- len = rb_sprintf(ptr_nick, "%s ", target_p->name);
- ptr_nick += len;
- len_nick += len;
len = rb_sprintf(ptr_uid, "%s ", use_id(target_p));
ptr_uid += len;
len_uid += len;
/* Keep the colon if we're sending an SJOIN without nicks -- jilles */
if (joins)
{
- *(ptr_nick - 1) = '\0';
*(ptr_uid - 1) = '\0';
}
sendto_server(client_p->from, NULL, CAP_TS6, NOCAPS, "%s", buf_uid);
- sendto_server(client_p->from, NULL, NOCAPS, CAP_TS6, "%s", buf_nick);
/* if the source does TS6 we have to remove our bans. Its now safe
* to issue -b's to the non-ts6 servers, as the sjoin we've just
if(MyClient(source_p) && !IsFloodDone(source_p))
flood_endgrace(source_p);
-
sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s JOIN 0", use_id(source_p));
- sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s JOIN 0", source_p->name);
if(source_p->user->channel.head && MyConnect(source_p) &&
!IsOper(source_p) && !IsExemptSpambot(source_p))