summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-02-07 23:58:51 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-02-07 23:58:51 +0000
commit747347c99086e76df85f4641f65c972fc21cb7d7 (patch)
tree9d8048ad6af3d69e078132305b2bd9a821431ba6
parent2891a871b79aad25d283d2a8ab8c74d3e39e2351 (diff)
downloadirssi-747347c99086e76df85f4641f65c972fc21cb7d7.zip
"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
-rw-r--r--src/fe-common/irc/fe-events-numeric.c9
-rw-r--r--src/fe-common/irc/fe-events.c10
2 files changed, 10 insertions, 9 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c
index e81379bd..3836b364 100644
--- a/src/fe-common/irc/fe-events-numeric.c
+++ b/src/fe-common/irc/fe-events-numeric.c
@@ -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);
diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c
index 8ba3bd3e..e8a9bbef 100644
--- a/src/fe-common/irc/fe-events.c
+++ b/src/fe-common/irc/fe-events.c
@@ -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)