summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/fe-events-numeric.c
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@irssi.org>2007-07-07 10:49:19 +0000
committerjilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-07-07 10:49:19 +0000
commit131d92c4d36fb7d0a89150c65ea87f5274876c26 (patch)
treec434f8c7ccc14975ee509539d7c0838624e322a1 /src/fe-common/irc/fe-events-numeric.c
parent3f84c9d19d34f1f5018f0419af0c002ec0bc43c1 (diff)
downloadirssi-131d92c4d36fb7d0a89150c65ea87f5274876c26.zip
Fix 477 numeric broken by r4572
(should be displayed in status if it's a join failure, channel window otherwise) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4574 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/fe-events-numeric.c')
-rw-r--r--src/fe-common/irc/fe-events-numeric.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c
index dcf8d5ba..2bb9471c 100644
--- a/src/fe-common/irc/fe-events-numeric.c
+++ b/src/fe-common/irc/fe-events-numeric.c
@@ -493,6 +493,26 @@ static void event_bad_channel_mask(IRC_SERVER_REC *server, const char *data)
cannot_join(server, data, IRCTXT_JOINERROR_BAD_MASK);
}
+static void event_477(IRC_SERVER_REC *server, const char *data,
+ const char *nick)
+{
+ /* Numeric 477 can mean many things:
+ * modeless channel, cannot join/send to channel (+r/+R/+M).
+ * If we tried to join this channel, display the error in the
+ * status window. Otherwise display it in the channel window.
+ */
+ IRC_CHANNEL_REC *chanrec;
+ char *params, *channel;
+
+ g_return_if_fail(data != NULL);
+
+ params = event_get_params(data, 2, NULL, &channel);
+
+ chanrec = irc_channel_find(server, channel);
+ print_event_received(server, data, nick, chanrec == NULL || chanrec->joined);
+ g_free(params);
+}
+
static void event_unknown_mode(IRC_SERVER_REC *server, const char *data)
{
char *params, *mode;
@@ -621,6 +641,7 @@ void fe_events_numeric_init(void)
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 477", (SIGNAL_FUNC) event_477);
signal_add("event 375", (SIGNAL_FUNC) event_motd);
signal_add("event 376", (SIGNAL_FUNC) event_motd);
signal_add("event 372", (SIGNAL_FUNC) event_motd);
@@ -659,7 +680,6 @@ void fe_events_numeric_init(void)
signal_add("event 404", (SIGNAL_FUNC) event_target_received); /* cannot send to channel */
signal_add("event 408", (SIGNAL_FUNC) event_target_received); /* cannot send (+c) */
signal_add("event 442", (SIGNAL_FUNC) event_target_received); /* you're not on that channel */
- signal_add("event 477", (SIGNAL_FUNC) event_target_received); /* modeless channel; cannot join/send to channel (+r/+R/+M) */
signal_add("event 478", (SIGNAL_FUNC) event_target_received); /* ban list is full */
signal_add("event 482", (SIGNAL_FUNC) event_target_received); /* not chanop */
signal_add("event 486", (SIGNAL_FUNC) event_target_received); /* cannot /msg (+R) */
@@ -710,6 +730,7 @@ void fe_events_numeric_deinit(void)
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 477", (SIGNAL_FUNC) event_477);
signal_remove("event 375", (SIGNAL_FUNC) event_motd);
signal_remove("event 376", (SIGNAL_FUNC) event_motd);
signal_remove("event 372", (SIGNAL_FUNC) event_motd);
@@ -744,7 +765,6 @@ void fe_events_numeric_deinit(void)
signal_remove("event 404", (SIGNAL_FUNC) event_target_received);
signal_remove("event 408", (SIGNAL_FUNC) event_target_received);
signal_remove("event 442", (SIGNAL_FUNC) event_target_received);
- signal_remove("event 477", (SIGNAL_FUNC) event_target_received);
signal_remove("event 478", (SIGNAL_FUNC) event_target_received);
signal_remove("event 482", (SIGNAL_FUNC) event_target_received);
signal_remove("event 486", (SIGNAL_FUNC) event_target_received);