Esempio n. 1
0
static void numeric_ready(struct socket_info *sinfo, char *params)
{
	char *channel, *info;

	strtok(params, " "); /* strip of username */
	channel = strtok(NULL, " ");
	info    = strtok(NULL, "");

	strip_char_from_end(':', info);
	strip_char_from_end('\r', info);

	botevent(EV_ENTERED,sinfo,NULL,channel,info);

}
Esempio n. 2
0
static int sm_topic(socket_info *sinfo, struct inputstruct *is)
{
	char *channel, *topic;
	clientinfo client;

	convert_clientinfo(sinfo,is->prefix, &client);

	channel = strtok(is->params, " ");	/* channel */
	topic = strtok(NULL, "");	/* topic */

	if (strlen(topic) <= 2)
		return(0) ; 

	strip_char_from_end(':', topic);
	strip_char_from_end('\r', topic);

	info_log("%s TOPIC %s by %s\n", channel, topic, client.nick);
	
	botevent(EV_TOPIC,sinfo,client.nick,channel,topic) ;	
	
	return (0);
}
Esempio n. 3
0
static void get_users_from_chan(struct socket_info *sinfo, char *params)
{
	char *channel;
	char cmode;
	struct clientinfo user;

	channel = strtok(params, " ");
	channel = strtok(NULL, " ");
	channel = strtok(NULL, " ");

	user.nick = strtok(NULL, " ");
	user.ident = NULL;
	user.address = NULL;
	user.server = GetServerBySocket(sinfo);

	if (user.nick[0] == ':')
		user.nick++;

	do {
		/* if it's not a char allowed at the beginning 
		   of the nick it's probably a mode char 
		 */

		if (!isnickstartchar(user.nick[0])) {
			cmode = user.nick[0];
			user.nick++;

		}

		AddUserToChannel(&user, channel);
		botevent(EV_HERE,sinfo,user.nick,channel,NULL);
		/* next User */
		user.nick = strtok(NULL, " ");

	} while (user.nick != NULL);
}