Example #1
0
/* FJOIN is like SJOIN, but not quite. It doesnt sync
 * simple-modes, or bans/excepts.
 */
int denora_event_fjoin(char *source, int ac, char **av)
{

    char *newav[127];
    char people[1024];
    int i = 0;

    if (denora->protocoldebug) {
        protocol_debug(source, ac, av);
    }

    if (ac < 3)
        return MOD_CONT;

    newav[0] = av[1];
    newav[1] = av[0];
    newav[2] = (char *) "+";
    newav[3] = people;

    *people = '\0';

    for (i = 2; i < ac; i++) {
        if (i > 2)
            strncat(people, " ", 1024);
        strncat(people, av[i], 1024);
    }
    do_sjoin(source, 4, newav);

    return MOD_CONT;
}
Example #2
0
int denora_event_sjoin(char *source, int ac, char **av)
{
    if (denora->protocoldebug) {
        protocol_debug(source, ac, av);
    }
    do_sjoin(source, ac, av);
    return MOD_CONT;
}
Example #3
0
int denora_event_sjoin(char *source, int ac, char **av)
{
	if (denora->protocoldebug)
	{
		protocol_debug(source, ac, av);
	}
	if (!strcmp(av[2], "0"))
		av[2] = sstrdup("+");
	do_sjoin(source, ac, av);
	return MOD_CONT;
}
Example #4
0
int xanadu_event_sjoin(char *source, int ac, char **av)
{
    do_sjoin(source, ac, av);
    return MOD_CONT;
}
Example #5
0
/* FJOIN is like SJOIN, but not quite. It doesnt sync
 * simple-modes, or bans/excepts.
 */
int denora_event_fjoin(char *source, int ac, char **av)
{
    char *newav[127];
    char people[1024];
    int i = 0;
    char *userv[256];
    int userc = 0;
    int nlen = 0;
    char prefixandnick[51];

    if (denora->protocoldebug) {
        protocol_debug(source, ac, av);
    }

    if (ac < 3)
        return MOD_CONT;

    newav[0] = av[1];           /* Timestamp */
    newav[1] = av[0];           /* Channel */
    newav[2] = (char *) "+";    /* Mode */
    newav[3] = people;          /* Nickname */

    *people = '\0';

    /*
     * We need to remove the comma and ignore unknown modes.
     * This code is based on work by w00t for atheme.
     */
    userc = sjtoken(av[ac - 1], ' ', userv);

    /* loop over all the users in this fjoin */
    for (i = 0; i < userc; i++) {
        nlen = 0;

        alog(LOG_DEBUG, "denora_event_fjoin(): processing user: %s",
             userv[i]);

        for (; *userv[i]; userv[i]++) {
            /* does this char match a known prefix? */
            if (csmodes[(int) *userv[i]]) {
                prefixandnick[nlen++] = *userv[i];
                continue;
            }

            /* have we reached the end of the prefixes? */
            if (*userv[i] == ',') {
                /* yup, skip over the comma */
                userv[i]++;

                /* create nick with prefixes */
                strlcpy(prefixandnick + nlen, userv[i],
                        sizeof(prefixandnick) - nlen);
                /* add the user */
                strncat(people, prefixandnick, sizeof(people) - 1);
                strncat(people, " ", sizeof(people) - 1);

                /* break out of this loop, which will move us to the next user */
                break;
            }
        }
    }

    do_sjoin(source, 4, newav);

    return MOD_CONT;
}
Example #6
0
static void m_sjoin( char *origin, char **argv, int argc, int srv )
{
	do_sjoin( argv[0], argv[1], ( ( argc >= 4 ) ? argv[2] : "" ), origin, argv, argc );
}