1
0
mirror of https://github.com/irssi/irssi.git synced 2024-08-04 03:34:18 -04:00

"default event" now resends "default event numeric" which gets handled by

the event_received() function.. I think now all those extra spaces showing
up in places should be fixed :)


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2402 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-02-07 23:58:51 +00:00 committed by cras
parent 2891a871b7
commit 747347c990
2 changed files with 10 additions and 9 deletions

View File

@ -750,6 +750,13 @@ static void event_not_chanop(IRC_SERVER_REC *server, const char *data)
g_free(params);
}
static void event_numeric(IRC_SERVER_REC *server, const char *data)
{
data = strchr(data, ' ');
if (data != NULL)
event_received(server, data+1);
}
static void event_received(IRC_SERVER_REC *server, const char *data)
{
char *args, *ptr;
@ -855,6 +862,7 @@ void fe_events_numeric_init(void)
signal_add("event 372", (SIGNAL_FUNC) event_motd);
signal_add("event 422", (SIGNAL_FUNC) event_motd);
signal_add("default event numeric", (SIGNAL_FUNC) event_numeric);
signal_add("event 001", (SIGNAL_FUNC) event_received);
signal_add("event 004", (SIGNAL_FUNC) event_received);
signal_add("event 254", (SIGNAL_FUNC) event_received);
@ -936,6 +944,7 @@ void fe_events_numeric_deinit(void)
signal_remove("event 372", (SIGNAL_FUNC) event_motd);
signal_remove("event 422", (SIGNAL_FUNC) event_motd);
signal_remove("default event numeric", (SIGNAL_FUNC) event_numeric);
signal_remove("event 001", (SIGNAL_FUNC) event_received);
signal_remove("event 004", (SIGNAL_FUNC) event_received);
signal_remove("event 254", (SIGNAL_FUNC) event_received);

View File

@ -393,21 +393,13 @@ static void sig_whowas_event_end(IRC_SERVER_REC *server, const char *data,
static void event_received(IRC_SERVER_REC *server, const char *data,
const char *nick, const char *addr)
{
char *params, *cmd, *args, *ptr;
g_return_if_fail(data != NULL);
if (!i_isdigit(*data)) {
printtext(server, NULL, MSGLEVEL_CRAP, "%s", data);
return;
}
/* numeric event. */
params = event_get_params(data, 3 | PARAM_FLAG_GETREST, &cmd, NULL, &args);
ptr = strstr(args, " :");
if (ptr != NULL) *(ptr+1) = ' ';
printtext(server, NULL, MSGLEVEL_CRAP, "%s", args);
g_free(params);
signal_emit("default event numeric", 4, server, data, nick, addr);
}
void fe_events_init(void)