mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05: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:
parent
2891a871b7
commit
747347c990
@ -750,6 +750,13 @@ static void event_not_chanop(IRC_SERVER_REC *server, const char *data)
|
|||||||
g_free(params);
|
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)
|
static void event_received(IRC_SERVER_REC *server, const char *data)
|
||||||
{
|
{
|
||||||
char *args, *ptr;
|
char *args, *ptr;
|
||||||
@ -855,6 +862,7 @@ void fe_events_numeric_init(void)
|
|||||||
signal_add("event 372", (SIGNAL_FUNC) event_motd);
|
signal_add("event 372", (SIGNAL_FUNC) event_motd);
|
||||||
signal_add("event 422", (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 001", (SIGNAL_FUNC) event_received);
|
||||||
signal_add("event 004", (SIGNAL_FUNC) event_received);
|
signal_add("event 004", (SIGNAL_FUNC) event_received);
|
||||||
signal_add("event 254", (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 372", (SIGNAL_FUNC) event_motd);
|
||||||
signal_remove("event 422", (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 001", (SIGNAL_FUNC) event_received);
|
||||||
signal_remove("event 004", (SIGNAL_FUNC) event_received);
|
signal_remove("event 004", (SIGNAL_FUNC) event_received);
|
||||||
signal_remove("event 254", (SIGNAL_FUNC) event_received);
|
signal_remove("event 254", (SIGNAL_FUNC) event_received);
|
||||||
|
@ -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,
|
static void event_received(IRC_SERVER_REC *server, const char *data,
|
||||||
const char *nick, const char *addr)
|
const char *nick, const char *addr)
|
||||||
{
|
{
|
||||||
char *params, *cmd, *args, *ptr;
|
|
||||||
|
|
||||||
g_return_if_fail(data != NULL);
|
|
||||||
|
|
||||||
if (!i_isdigit(*data)) {
|
if (!i_isdigit(*data)) {
|
||||||
printtext(server, NULL, MSGLEVEL_CRAP, "%s", data);
|
printtext(server, NULL, MSGLEVEL_CRAP, "%s", data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* numeric event. */
|
/* numeric event. */
|
||||||
params = event_get_params(data, 3 | PARAM_FLAG_GETREST, &cmd, NULL, &args);
|
signal_emit("default event numeric", 4, server, data, nick, addr);
|
||||||
ptr = strstr(args, " :");
|
|
||||||
if (ptr != NULL) *(ptr+1) = ' ';
|
|
||||||
printtext(server, NULL, MSGLEVEL_CRAP, "%s", args);
|
|
||||||
g_free(params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void fe_events_init(void)
|
void fe_events_init(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user