Exemplo n.º 1
0
static int
ctcp_check (session *sess, char *tbuf, char *nick, char *word[],
				char *word_eol[], char *ctcp)
{
	int ret = 0;
	char *po;
	struct popup *pop;
	GSList *list = ctcp_list;

	po = strchr (ctcp, '\001');
	if (po)
		*po = 0;

	po = strchr (word_eol[5], '\001');
	if (po)
		*po = 0;

	while (list)
	{
		pop = (struct popup *) list->data;
		if (!strcasecmp (ctcp, pop->name))
		{
			ctcp_reply (sess, tbuf, nick, word, word_eol, pop->cmd);
			ret = 1;
		}
		list = list->next;
	}
	return ret;
}
Exemplo n.º 2
0
void IRC_Session::on_msgCtcpReplyReceived(const QString& origin, const QString& reply) {
    Message temp;
    temp.text = reply;
    temp.sender = origin;
    temp.eventType = "CTCP-REPLY";
    temp.timestamp = QTime::currentTime();
    emit ctcp_reply(this,temp);
    return;
}
Exemplo n.º 3
0
static int ctcp_ping(struct userlist *user, const char *data)
{
	time_t ping_t;

	if (data == NULL) {
		/* if no params send the time in seconds */
		time(&ping_t);
		ctcp_reply(user, "PING %li", (long) ping_t);
		return(0);
	}

	/* if an argument exists, send the same one back */
	if (strlen(data) > 100) {
		/* someone is trying to overflow us */
		return (0);
	}

	ctcp_reply(user, "PING %s", data);
	return(0);
}
Exemplo n.º 4
0
static int ctcp_time(struct userlist *user, const char * UNUSED(data))
{
	char timestr[50];

	time(&currtime);

	strftime(timestr, sizeof(timestr), "%a %b %d %H:%M:%Y",
		 localtime(&currtime));

	ctcp_reply(user, "TIME %s", timestr);
	return(0);
}
Exemplo n.º 5
0
static int ctcp_version(struct userlist *user, const char * UNUSED(data))
{
	ctcp_reply(user, "VERSION %s", botinfo->ver);
	return(0);
}