2000-04-26 04:03:38 -04:00
|
|
|
/*
|
|
|
|
fe-events-numeric.c : irssi
|
|
|
|
|
|
|
|
Copyright (C) 1999-2000 Timo Sirainen
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "module.h"
|
|
|
|
#include "module-formats.h"
|
|
|
|
#include "signals.h"
|
2000-06-30 18:01:36 -04:00
|
|
|
#include "misc.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
#include "settings.h"
|
|
|
|
|
|
|
|
#include "irc.h"
|
|
|
|
#include "levels.h"
|
2000-08-26 11:39:44 -04:00
|
|
|
#include "servers.h"
|
|
|
|
#include "irc-channels.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
#include "nicklist.h"
|
|
|
|
|
2001-01-28 10:46:00 -05:00
|
|
|
#include "../core/module-formats.h"
|
2000-10-28 16:14:19 -04:00
|
|
|
#include "printtext.h"
|
2001-01-28 10:46:00 -05:00
|
|
|
#include "fe-channels.h"
|
2000-10-28 16:14:19 -04:00
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_received(IRC_SERVER_REC *server, const char *data);
|
2000-11-04 11:54:58 -05:00
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
static char *last_away_nick = NULL;
|
|
|
|
static char *last_away_msg = NULL;
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_user_mode(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *mode;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
g_return_if_fail(server != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &mode);
|
2000-12-02 20:43:07 -05:00
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_USER_MODE,
|
|
|
|
g_strchomp(mode));
|
2000-06-25 18:25:24 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_ison(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *online;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
g_return_if_fail(server != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &online);
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_ONLINE, online);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_names_list(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel, *names;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 4, NULL, NULL, &channel, &names);
|
2001-01-28 10:46:00 -05:00
|
|
|
if (irc_channel_find(server, channel) == NULL) {
|
|
|
|
printformat_module("fe-common/core", server, channel,
|
|
|
|
MSGLEVEL_CRAP, TXT_NAMES,
|
|
|
|
channel, names);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
2001-01-28 10:46:00 -05:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_end_of_names(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel;
|
2000-08-26 11:39:44 -04:00
|
|
|
IRC_CHANNEL_REC *chanrec;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &channel);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-08-26 11:39:44 -04:00
|
|
|
chanrec = irc_channel_find(server, channel);
|
2001-01-28 10:46:00 -05:00
|
|
|
if (chanrec != NULL)
|
|
|
|
fe_channels_nicklist(CHANNEL(chanrec));
|
|
|
|
else {
|
|
|
|
printformat_module("fe-common/core", server, channel,
|
|
|
|
MSGLEVEL_CRAP, TXT_ENDOFNAMES,
|
|
|
|
channel, 0, 0, 0, 0);
|
|
|
|
}
|
2000-06-25 18:25:24 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_who(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *nick, *channel, *user, *host, *stat, *realname, *hops;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 8, NULL, &channel, &user, &host, NULL, &nick, &stat, &realname);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
/* split hops/realname */
|
|
|
|
hops = realname;
|
|
|
|
while (*realname != '\0' && *realname != ' ') realname++;
|
|
|
|
while (*realname == ' ') realname++;
|
|
|
|
if (realname > hops) realname[-1] = '\0';
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_WHO,
|
|
|
|
channel, nick, stat, hops, user, host, realname);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_end_of_who(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &channel);
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_END_OF_WHO, channel);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_ban_list(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel, *ban, *setby, *tims;
|
|
|
|
long secs;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 5, NULL, &channel, &ban, &setby, &tims);
|
|
|
|
secs = *tims == '\0' ? 0 :
|
|
|
|
(long) (time(NULL) - atol(tims));
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP,
|
|
|
|
*setby == '\0' ? IRCTXT_BANLIST : IRCTXT_BANLIST_LONG,
|
2001-01-07 05:11:29 -05:00
|
|
|
0, channel, ban, setby, secs);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_eban_list(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel, *ban, *setby, *tims;
|
|
|
|
long secs;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 5, NULL, &channel, &ban, &setby, &tims);
|
|
|
|
secs = *tims == '\0' ? 0 :
|
|
|
|
(long) (time(NULL) - atol(tims));
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP,
|
|
|
|
*setby == '\0' ? IRCTXT_EBANLIST : IRCTXT_EBANLIST_LONG,
|
|
|
|
channel, ban, setby, secs);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_silence_list(IRC_SERVER_REC *server, const char *data)
|
2000-10-01 17:00:59 -04:00
|
|
|
{
|
|
|
|
char *params, *nick, *mask;
|
|
|
|
|
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
|
|
|
params = event_get_params(data, 3, NULL, &nick, &mask);
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_SILENCE_LINE, nick, mask);
|
|
|
|
g_free(params);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_invite_list(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel, *invite;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 3, NULL, &channel, &invite);
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_INVITELIST, channel, invite);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_nick_in_use(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *nick;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &nick);
|
|
|
|
if (server->connected)
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_NICK_IN_USE, nick);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_topic_get(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel, *topic;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 3, NULL, &channel, &topic);
|
|
|
|
printformat(server, channel, MSGLEVEL_CRAP, IRCTXT_TOPIC, channel, topic);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_topic_info(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-12-05 16:12:52 -05:00
|
|
|
char *params, *timestr, *channel, *topicby, *topictime;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
|
|
|
params = event_get_params(data, 4, NULL, &channel,
|
|
|
|
&topicby, &topictime);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-01-14 13:16:39 -05:00
|
|
|
timestr = my_asctime((time_t) atol(topictime));
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
printformat(server, channel, MSGLEVEL_CRAP,
|
|
|
|
IRCTXT_TOPIC_INFO, topicby, timestr);
|
|
|
|
g_free(timestr);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_channel_mode(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel, *mode;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 3 | PARAM_FLAG_GETREST, NULL, &channel, &mode);
|
2000-12-02 20:43:07 -05:00
|
|
|
printformat(server, channel, MSGLEVEL_CRAP, IRCTXT_CHANNEL_MODE,
|
|
|
|
channel, g_strchomp(mode));
|
2000-06-25 18:25:24 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_channel_created(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-12-05 16:12:52 -05:00
|
|
|
char *params, *channel, *createtime, *timestr;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
|
|
|
params = event_get_params(data, 3, NULL, &channel, &createtime);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-01-14 13:16:39 -05:00
|
|
|
timestr = my_asctime((time_t) atol(createtime));
|
2000-12-05 16:12:52 -05:00
|
|
|
printformat(server, channel, MSGLEVEL_CRAP,
|
|
|
|
IRCTXT_CHANNEL_CREATED, channel, timestr);
|
|
|
|
g_free(timestr);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_away(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_AWAY);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_unaway(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_UNAWAY);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_userhost(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-04-27 08:10:38 -04:00
|
|
|
char *params, *hosts;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-04-27 08:10:38 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-04-27 08:10:38 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &hosts);
|
|
|
|
printtext(server, NULL, MSGLEVEL_CRAP, "%s", hosts);
|
|
|
|
g_free(params);
|
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_sent_invite(IRC_SERVER_REC *server, const char *data)
|
2000-04-27 08:10:38 -04:00
|
|
|
{
|
|
|
|
char *params, *nick, *channel;
|
|
|
|
|
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
2000-04-28 05:02:44 -04:00
|
|
|
params = event_get_params(data, 3, NULL, &nick, &channel);
|
2000-06-25 18:25:24 -04:00
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_INVITING, nick, channel);
|
2000-04-27 08:10:38 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_whois(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *nick, *user, *host, *realname;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 6, NULL, &nick, &user, &host, NULL, &realname);
|
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOIS, nick, user, host, realname);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_whois_idle(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2001-01-14 13:16:39 -05:00
|
|
|
char *params, *nick, *secstr, *signonstr, *rest, *timestr;
|
2000-07-18 19:35:04 -04:00
|
|
|
long days, hours, mins, secs;
|
|
|
|
time_t signon;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-07-18 19:35:04 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-07-18 19:35:04 -04:00
|
|
|
params = event_get_params(data, 5 | PARAM_FLAG_GETREST, NULL,
|
|
|
|
&nick, &secstr, &signonstr, &rest);
|
|
|
|
|
|
|
|
secs = atol(secstr);
|
|
|
|
signon = strstr(rest, "signon time") == NULL ? 0 :
|
|
|
|
(time_t) atol(signonstr);
|
|
|
|
|
|
|
|
days = secs/3600/24;
|
|
|
|
hours = (secs%(3600*24))/3600;
|
|
|
|
mins = (secs%3600)/60;
|
|
|
|
secs %= 60;
|
|
|
|
|
2000-07-20 19:10:35 -04:00
|
|
|
if (signon == 0)
|
2000-07-18 19:35:04 -04:00
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOIS_IDLE,
|
|
|
|
nick, days, hours, mins, secs);
|
|
|
|
else {
|
2001-01-14 13:16:39 -05:00
|
|
|
timestr = my_asctime(signon);
|
2000-07-18 19:35:04 -04:00
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOIS_IDLE_SIGNON,
|
|
|
|
nick, days, hours, mins, secs, timestr);
|
|
|
|
g_free(timestr);
|
|
|
|
}
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_whois_server(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *nick, *whoserver, *desc;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 4, NULL, &nick, &whoserver, &desc);
|
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOIS_SERVER, nick, whoserver, desc);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_whois_oper(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *nick;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &nick);
|
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOIS_OPER, nick);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_whois_registered(IRC_SERVER_REC *server, const char *data)
|
2000-08-10 08:23:56 -04:00
|
|
|
{
|
|
|
|
char *params, *nick;
|
|
|
|
|
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
|
|
|
params = event_get_params(data, 2, NULL, &nick);
|
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOIS_REGISTERED, nick);
|
|
|
|
g_free(params);
|
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_whowas(IRC_SERVER_REC *server, const char *data)
|
2000-06-10 17:40:00 -04:00
|
|
|
{
|
|
|
|
char *params, *nick, *user, *host, *realname;
|
|
|
|
|
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
|
|
|
params = event_get_params(data, 6, NULL, &nick, &user, &host, NULL, &realname);
|
2000-06-25 18:25:24 -04:00
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOWAS, nick, user, host, realname);
|
2000-06-10 17:40:00 -04:00
|
|
|
g_free(params);
|
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_whois_channels(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *nick, *chans;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 3, NULL, &nick, &chans);
|
|
|
|
|
|
|
|
/* sure - we COULD print the channel names as-is, but since the
|
|
|
|
colors, bolds, etc. are mostly just to fool people, I think we
|
|
|
|
should show the channel names as they REALLY are so they could
|
|
|
|
even be joined without any extra tricks. */
|
2000-06-30 15:54:34 -04:00
|
|
|
chans = show_lowascii(chans);
|
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_WHOIS_CHANNELS, nick, chans);
|
|
|
|
g_free(chans);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_whois_away(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *nick, *awaymsg;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 3, NULL, &nick, &awaymsg);
|
|
|
|
if (server->whois_coming || !settings_get_bool("show_away_once") ||
|
|
|
|
last_away_nick == NULL || g_strcasecmp(last_away_nick, nick) != 0 ||
|
|
|
|
last_away_msg == NULL || g_strcasecmp(last_away_msg, awaymsg) != 0) {
|
|
|
|
/* don't show the same away message from the same nick all the time */
|
|
|
|
g_free_not_null(last_away_nick);
|
|
|
|
g_free_not_null(last_away_msg);
|
|
|
|
last_away_nick = g_strdup(nick);
|
|
|
|
last_away_msg = g_strdup(awaymsg);
|
|
|
|
|
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, server->whois_coming ?
|
|
|
|
IRCTXT_WHOIS_AWAY : IRCTXT_NICK_AWAY, nick, awaymsg);
|
|
|
|
}
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_end_of_whois(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-10 17:40:00 -04:00
|
|
|
char *params, *nick;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-10 17:40:00 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-10 17:40:00 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &nick);
|
2000-06-25 18:25:24 -04:00
|
|
|
if (server->whois_found) printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_END_OF_WHOIS, nick);
|
2000-06-10 17:40:00 -04:00
|
|
|
g_free(params);
|
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_chanserv_url(IRC_SERVER_REC *server, const char *data)
|
2000-10-14 15:28:14 -04:00
|
|
|
{
|
|
|
|
char *params, *channel, *url;
|
|
|
|
|
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
|
|
|
params = event_get_params(data, 3, NULL, &channel, &url);
|
2000-10-14 15:43:01 -04:00
|
|
|
printformat(server, channel, MSGLEVEL_CRAP, IRCTXT_CHANNEL_URL, channel, url);
|
2000-10-14 15:28:14 -04:00
|
|
|
g_free(params);
|
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_end_of_whowas(IRC_SERVER_REC *server, const char *data)
|
2000-06-10 17:40:00 -04:00
|
|
|
{
|
|
|
|
char *params, *nick;
|
|
|
|
|
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
|
|
|
params = event_get_params(data, 2, NULL, &nick);
|
2000-06-25 18:25:24 -04:00
|
|
|
if (server->whowas_found) printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_END_OF_WHOWAS, nick);
|
2000-06-10 17:40:00 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_target_unavailable(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel;
|
2000-11-04 11:54:58 -05:00
|
|
|
IRC_CHANNEL_REC *chanrec;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &channel);
|
|
|
|
if (!ischannel(*channel)) {
|
|
|
|
/* nick unavailable */
|
2000-11-04 11:54:58 -05:00
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP,
|
|
|
|
IRCTXT_NICK_UNAVAILABLE, channel);
|
2000-06-25 18:25:24 -04:00
|
|
|
} else {
|
2000-11-04 11:54:58 -05:00
|
|
|
chanrec = irc_channel_find(server, channel);
|
|
|
|
if (chanrec != NULL && chanrec->joined) {
|
|
|
|
/* dalnet - can't change nick while being banned */
|
2000-12-05 16:12:52 -05:00
|
|
|
event_received(server, data);
|
2000-11-04 11:54:58 -05:00
|
|
|
} else {
|
|
|
|
/* channel is unavailable. */
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP,
|
|
|
|
IRCTXT_JOINERROR_UNAVAIL, channel);
|
|
|
|
}
|
2000-06-25 18:25:24 -04:00
|
|
|
}
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_no_such_nick(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *nick;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &nick);
|
|
|
|
printformat(server, nick, MSGLEVEL_CRAP, IRCTXT_NO_SUCH_NICK, nick);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_no_such_channel(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &channel);
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_NO_SUCH_CHANNEL, channel);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void cannot_join(IRC_SERVER_REC *server, const char *data, int format)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &channel);
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, format, channel);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_too_many_channels(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-12-05 16:12:52 -05:00
|
|
|
cannot_join(server, data, IRCTXT_JOINERROR_TOOMANY);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_duplicate_channel(IRC_SERVER_REC *server, const char *data)
|
2000-10-13 21:03:11 -04:00
|
|
|
{
|
|
|
|
char *params, *channel, *p;
|
|
|
|
|
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
|
|
|
/* this new addition to ircd breaks completely with older
|
|
|
|
"standards", "nick Duplicate ::!!channel ...." */
|
|
|
|
params = event_get_params(data, 3, NULL, NULL, &channel);
|
|
|
|
p = strchr(channel, ' ');
|
|
|
|
if (p != NULL) *p = '\0';
|
|
|
|
|
|
|
|
if (channel[0] == '!' && channel[1] == '!') {
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP,
|
|
|
|
IRCTXT_JOINERROR_DUPLICATE, channel+1);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free(params);
|
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_channel_is_full(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-12-05 16:12:52 -05:00
|
|
|
cannot_join(server, data, IRCTXT_JOINERROR_FULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_invite_only(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-12-05 16:12:52 -05:00
|
|
|
cannot_join(server, data, IRCTXT_JOINERROR_INVITE);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_banned(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-12-05 16:12:52 -05:00
|
|
|
cannot_join(server, data, IRCTXT_JOINERROR_BANNED);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_bad_channel_key(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-12-05 16:12:52 -05:00
|
|
|
cannot_join(server, data, IRCTXT_JOINERROR_BAD_KEY);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_bad_channel_mask(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-12-05 16:12:52 -05:00
|
|
|
cannot_join(server, data, IRCTXT_JOINERROR_BAD_MASK);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_unknown_mode(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *mode;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &mode);
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_UNKNOWN_MODE, mode);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_not_chanop(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *channel;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2, NULL, &channel);
|
|
|
|
printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_NOT_CHANOP, channel);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_received(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-25 18:25:24 -04:00
|
|
|
char *params, *args, *ptr;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-25 18:25:24 -04:00
|
|
|
params = event_get_params(data, 2 | PARAM_FLAG_GETREST, NULL, &args);
|
|
|
|
ptr = strstr(args, " :");
|
2001-01-04 03:49:48 -05:00
|
|
|
if (ptr != NULL)
|
2001-01-17 20:03:18 -05:00
|
|
|
g_memmove(ptr+1, ptr+2, strlen(ptr+1));
|
2000-06-25 18:25:24 -04:00
|
|
|
printtext(server, NULL, MSGLEVEL_CRAP, "%s", args);
|
|
|
|
g_free(params);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-05 16:12:52 -05:00
|
|
|
static void event_motd(IRC_SERVER_REC *server, const char *data)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-06-01 12:55:15 -04:00
|
|
|
/* don't ignore motd anymore after 3 seconds of connection time -
|
|
|
|
we might have called /MOTD */
|
|
|
|
if (settings_get_bool("skip_motd") &&
|
|
|
|
time(NULL)-3 <= server->real_connect_time)
|
|
|
|
return;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-01-04 03:49:48 -05:00
|
|
|
event_received(server, data);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-10-01 17:00:59 -04:00
|
|
|
static void sig_empty(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void fe_events_numeric_init(void)
|
|
|
|
{
|
|
|
|
last_away_nick = NULL;
|
|
|
|
last_away_msg = NULL;
|
|
|
|
|
|
|
|
signal_add("event 221", (SIGNAL_FUNC) event_user_mode);
|
|
|
|
signal_add("event 303", (SIGNAL_FUNC) event_ison);
|
|
|
|
signal_add("event 353", (SIGNAL_FUNC) event_names_list);
|
|
|
|
signal_add("event 366", (SIGNAL_FUNC) event_end_of_names);
|
|
|
|
signal_add("event 352", (SIGNAL_FUNC) event_who);
|
|
|
|
signal_add("event 315", (SIGNAL_FUNC) event_end_of_who);
|
2000-10-01 17:00:59 -04:00
|
|
|
signal_add("event 271", (SIGNAL_FUNC) event_silence_list);
|
|
|
|
signal_add("event 272", (SIGNAL_FUNC) sig_empty);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_add("event 367", (SIGNAL_FUNC) event_ban_list);
|
|
|
|
signal_add("event 348", (SIGNAL_FUNC) event_eban_list);
|
|
|
|
signal_add("event 346", (SIGNAL_FUNC) event_invite_list);
|
|
|
|
signal_add("event 433", (SIGNAL_FUNC) event_nick_in_use);
|
|
|
|
signal_add("event 332", (SIGNAL_FUNC) event_topic_get);
|
|
|
|
signal_add("event 333", (SIGNAL_FUNC) event_topic_info);
|
|
|
|
signal_add("event 324", (SIGNAL_FUNC) event_channel_mode);
|
|
|
|
signal_add("event 329", (SIGNAL_FUNC) event_channel_created);
|
|
|
|
signal_add("event 306", (SIGNAL_FUNC) event_away);
|
|
|
|
signal_add("event 305", (SIGNAL_FUNC) event_unaway);
|
|
|
|
signal_add("event 311", (SIGNAL_FUNC) event_whois);
|
|
|
|
signal_add("event 301", (SIGNAL_FUNC) event_whois_away);
|
|
|
|
signal_add("event 312", (SIGNAL_FUNC) event_whois_server);
|
|
|
|
signal_add("event 313", (SIGNAL_FUNC) event_whois_oper);
|
2000-08-10 08:23:56 -04:00
|
|
|
signal_add("event 307", (SIGNAL_FUNC) event_whois_registered);
|
2000-06-10 17:40:00 -04:00
|
|
|
signal_add("event 314", (SIGNAL_FUNC) event_whowas);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_add("event 317", (SIGNAL_FUNC) event_whois_idle);
|
|
|
|
signal_add("event 318", (SIGNAL_FUNC) event_end_of_whois);
|
2000-10-14 15:28:14 -04:00
|
|
|
signal_add("event 328", (SIGNAL_FUNC) event_chanserv_url);
|
2000-06-10 17:40:00 -04:00
|
|
|
signal_add("event 369", (SIGNAL_FUNC) event_end_of_whowas);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_add("event 319", (SIGNAL_FUNC) event_whois_channels);
|
|
|
|
signal_add("event 302", (SIGNAL_FUNC) event_userhost);
|
2000-04-27 08:10:38 -04:00
|
|
|
signal_add("event 341", (SIGNAL_FUNC) event_sent_invite);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
signal_add("event 437", (SIGNAL_FUNC) event_target_unavailable);
|
|
|
|
signal_add("event 401", (SIGNAL_FUNC) event_no_such_nick);
|
|
|
|
signal_add("event 403", (SIGNAL_FUNC) event_no_such_channel);
|
|
|
|
signal_add("event 405", (SIGNAL_FUNC) event_too_many_channels);
|
2000-10-13 21:03:11 -04:00
|
|
|
signal_add("event 407", (SIGNAL_FUNC) event_duplicate_channel);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_add("event 471", (SIGNAL_FUNC) event_channel_is_full);
|
|
|
|
signal_add("event 472", (SIGNAL_FUNC) event_unknown_mode);
|
|
|
|
signal_add("event 473", (SIGNAL_FUNC) event_invite_only);
|
|
|
|
signal_add("event 474", (SIGNAL_FUNC) event_banned);
|
|
|
|
signal_add("event 475", (SIGNAL_FUNC) event_bad_channel_key);
|
|
|
|
signal_add("event 476", (SIGNAL_FUNC) event_bad_channel_mask);
|
|
|
|
signal_add("event 482", (SIGNAL_FUNC) event_not_chanop);
|
|
|
|
signal_add("event 375", (SIGNAL_FUNC) event_motd);
|
|
|
|
signal_add("event 376", (SIGNAL_FUNC) event_motd);
|
|
|
|
signal_add("event 372", (SIGNAL_FUNC) event_motd);
|
2000-06-01 12:55:15 -04:00
|
|
|
signal_add("event 422", (SIGNAL_FUNC) event_motd);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
signal_add("event 004", (SIGNAL_FUNC) event_received);
|
2001-01-04 03:49:48 -05:00
|
|
|
signal_add("event 254", (SIGNAL_FUNC) event_received);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_add("event 364", (SIGNAL_FUNC) event_received);
|
|
|
|
signal_add("event 365", (SIGNAL_FUNC) event_received);
|
2000-11-04 11:54:58 -05:00
|
|
|
signal_add("event 432", (SIGNAL_FUNC) event_received);
|
|
|
|
signal_add("event 438", (SIGNAL_FUNC) event_received);
|
2000-06-11 15:34:29 -04:00
|
|
|
signal_add("event 465", (SIGNAL_FUNC) event_received);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void fe_events_numeric_deinit(void)
|
|
|
|
{
|
|
|
|
g_free_not_null(last_away_nick);
|
|
|
|
g_free_not_null(last_away_msg);
|
|
|
|
|
|
|
|
signal_remove("event 221", (SIGNAL_FUNC) event_user_mode);
|
|
|
|
signal_remove("event 303", (SIGNAL_FUNC) event_ison);
|
|
|
|
signal_remove("event 353", (SIGNAL_FUNC) event_names_list);
|
|
|
|
signal_remove("event 366", (SIGNAL_FUNC) event_end_of_names);
|
|
|
|
signal_remove("event 352", (SIGNAL_FUNC) event_who);
|
|
|
|
signal_remove("event 315", (SIGNAL_FUNC) event_end_of_who);
|
2000-10-01 17:00:59 -04:00
|
|
|
signal_remove("event 271", (SIGNAL_FUNC) event_silence_list);
|
|
|
|
signal_remove("event 272", (SIGNAL_FUNC) sig_empty);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_remove("event 367", (SIGNAL_FUNC) event_ban_list);
|
|
|
|
signal_remove("event 348", (SIGNAL_FUNC) event_eban_list);
|
|
|
|
signal_remove("event 346", (SIGNAL_FUNC) event_invite_list);
|
|
|
|
signal_remove("event 433", (SIGNAL_FUNC) event_nick_in_use);
|
|
|
|
signal_remove("event 332", (SIGNAL_FUNC) event_topic_get);
|
|
|
|
signal_remove("event 333", (SIGNAL_FUNC) event_topic_info);
|
|
|
|
signal_remove("event 324", (SIGNAL_FUNC) event_channel_mode);
|
|
|
|
signal_remove("event 329", (SIGNAL_FUNC) event_channel_created);
|
|
|
|
signal_remove("event 306", (SIGNAL_FUNC) event_away);
|
|
|
|
signal_remove("event 305", (SIGNAL_FUNC) event_unaway);
|
|
|
|
signal_remove("event 311", (SIGNAL_FUNC) event_whois);
|
|
|
|
signal_remove("event 301", (SIGNAL_FUNC) event_whois_away);
|
|
|
|
signal_remove("event 312", (SIGNAL_FUNC) event_whois_server);
|
|
|
|
signal_remove("event 313", (SIGNAL_FUNC) event_whois_oper);
|
2000-08-10 08:23:56 -04:00
|
|
|
signal_remove("event 307", (SIGNAL_FUNC) event_whois_registered);
|
2000-06-10 17:40:00 -04:00
|
|
|
signal_remove("event 314", (SIGNAL_FUNC) event_whowas);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_remove("event 317", (SIGNAL_FUNC) event_whois_idle);
|
|
|
|
signal_remove("event 318", (SIGNAL_FUNC) event_end_of_whois);
|
2000-10-14 15:28:14 -04:00
|
|
|
signal_remove("event 328", (SIGNAL_FUNC) event_chanserv_url);
|
2000-06-10 17:40:00 -04:00
|
|
|
signal_remove("event 369", (SIGNAL_FUNC) event_end_of_whowas);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_remove("event 319", (SIGNAL_FUNC) event_whois_channels);
|
|
|
|
signal_remove("event 302", (SIGNAL_FUNC) event_userhost);
|
2000-04-27 08:10:38 -04:00
|
|
|
signal_remove("event 341", (SIGNAL_FUNC) event_sent_invite);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
signal_remove("event 437", (SIGNAL_FUNC) event_target_unavailable);
|
|
|
|
signal_remove("event 401", (SIGNAL_FUNC) event_no_such_nick);
|
|
|
|
signal_remove("event 403", (SIGNAL_FUNC) event_no_such_channel);
|
|
|
|
signal_remove("event 405", (SIGNAL_FUNC) event_too_many_channels);
|
2000-10-13 21:03:11 -04:00
|
|
|
signal_remove("event 407", (SIGNAL_FUNC) event_duplicate_channel);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_remove("event 471", (SIGNAL_FUNC) event_channel_is_full);
|
|
|
|
signal_remove("event 472", (SIGNAL_FUNC) event_unknown_mode);
|
|
|
|
signal_remove("event 473", (SIGNAL_FUNC) event_invite_only);
|
|
|
|
signal_remove("event 474", (SIGNAL_FUNC) event_banned);
|
|
|
|
signal_remove("event 475", (SIGNAL_FUNC) event_bad_channel_key);
|
|
|
|
signal_remove("event 476", (SIGNAL_FUNC) event_bad_channel_mask);
|
|
|
|
signal_remove("event 482", (SIGNAL_FUNC) event_not_chanop);
|
|
|
|
signal_remove("event 375", (SIGNAL_FUNC) event_motd);
|
|
|
|
signal_remove("event 376", (SIGNAL_FUNC) event_motd);
|
|
|
|
signal_remove("event 372", (SIGNAL_FUNC) event_motd);
|
2000-06-01 12:55:15 -04:00
|
|
|
signal_remove("event 422", (SIGNAL_FUNC) event_motd);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
signal_remove("event 004", (SIGNAL_FUNC) event_received);
|
2001-01-04 03:49:48 -05:00
|
|
|
signal_remove("event 254", (SIGNAL_FUNC) event_received);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_remove("event 364", (SIGNAL_FUNC) event_received);
|
|
|
|
signal_remove("event 365", (SIGNAL_FUNC) event_received);
|
2000-11-04 11:54:58 -05:00
|
|
|
signal_remove("event 432", (SIGNAL_FUNC) event_received);
|
|
|
|
signal_remove("event 438", (SIGNAL_FUNC) event_received);
|
2000-06-11 15:34:29 -04:00
|
|
|
signal_remove("event 465", (SIGNAL_FUNC) event_received);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|