summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/irc/fe-events-numeric.c2
-rw-r--r--src/fe-common/irc/fe-irc-channels.c17
2 files changed, 12 insertions, 7 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c
index 2bb9471c..40d05a75 100644
--- a/src/fe-common/irc/fe-events-numeric.c
+++ b/src/fe-common/irc/fe-events-numeric.c
@@ -666,6 +666,7 @@ void fe_events_numeric_init(void)
signal_add("event 438", (SIGNAL_FUNC) event_received);
signal_add("event 465", (SIGNAL_FUNC) event_received);
signal_add("event 439", (SIGNAL_FUNC) event_received);
+ signal_add("event 470", (SIGNAL_FUNC) event_received);
signal_add("event 479", (SIGNAL_FUNC) event_received);
signal_add("event 344", (SIGNAL_FUNC) event_target_received); /* reop list */
@@ -751,6 +752,7 @@ void fe_events_numeric_deinit(void)
signal_remove("event 438", (SIGNAL_FUNC) event_received);
signal_remove("event 465", (SIGNAL_FUNC) event_received);
signal_remove("event 439", (SIGNAL_FUNC) event_received);
+ signal_remove("event 470", (SIGNAL_FUNC) event_received);
signal_remove("event 479", (SIGNAL_FUNC) event_received);
signal_remove("event 344", (SIGNAL_FUNC) event_target_received);
diff --git a/src/fe-common/irc/fe-irc-channels.c b/src/fe-common/irc/fe-irc-channels.c
index 56efe9dd..e884aef4 100644
--- a/src/fe-common/irc/fe-irc-channels.c
+++ b/src/fe-common/irc/fe-irc-channels.c
@@ -39,16 +39,19 @@ static void sig_channel_rejoin(SERVER_REC *server, REJOIN_REC *rec)
IRCTXT_CHANNEL_REJOIN, rec->channel);
}
-static void sig_event_forward(SERVER_REC *server, const char *data)
+static void sig_event_forward(SERVER_REC *server, const char *data,
+ const char *nick)
{
IRC_CHANNEL_REC *channel;
char *params, *from, *to;
params = event_get_params(data, 3, NULL, &from, &to);
- channel = irc_channel_find(server, from);
- if (channel != NULL) {
- window_bind_add(window_item_window(channel),
- server->tag, to);
+ if (from != NULL && to != NULL && ischannel(*from) && ischannel(*to)) {
+ channel = irc_channel_find(server, from);
+ if (channel != NULL && irc_channel_find(server, to) == NULL) {
+ window_bind_add(window_item_window(channel),
+ server->tag, to);
+ }
}
g_free(params);
}
@@ -56,11 +59,11 @@ static void sig_event_forward(SERVER_REC *server, const char *data)
void fe_irc_channels_init(void)
{
signal_add("channel rejoin new", (SIGNAL_FUNC) sig_channel_rejoin);
- signal_add_first("event 379", (SIGNAL_FUNC) sig_event_forward);
+ signal_add_first("event 470", (SIGNAL_FUNC) sig_event_forward);
}
void fe_irc_channels_deinit(void)
{
signal_remove("channel rejoin new", (SIGNAL_FUNC) sig_channel_rejoin);
- signal_remove("event 379", (SIGNAL_FUNC) sig_event_forward);
+ signal_remove("event 470", (SIGNAL_FUNC) sig_event_forward);
}