summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-06-06 20:41:38 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-06-06 20:41:38 +0000
commit55b4ae92b8187572efdbe8623cecec47bacde7e7 (patch)
tree9a5e88bfbdaa10a4c7620ad12d4856b79a77055b /src
parent82a640763469f95af8fca2571f8d02859873d0eb (diff)
downloadirssi-55b4ae92b8187572efdbe8623cecec47bacde7e7.zip
Added /SET show_names_on_join, /QUOTE NAMES #channel now prints the names
list in raw format rather than just ignoring the reply and printing the nicks from cache. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2845 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/fe-channels.c9
-rw-r--r--src/fe-common/irc/fe-events-numeric.c17
2 files changed, 19 insertions, 7 deletions
diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c
index f80c4173..7aae6dbd 100644
--- a/src/fe-common/core/fe-channels.c
+++ b/src/fe-common/core/fe-channels.c
@@ -103,6 +103,12 @@ static void signal_window_item_changed(WINDOW_REC *window, WI_ITEM_REC *item)
}
}
+static void sig_channel_joined(CHANNEL_REC *channel)
+{
+ if (settings_get_bool("show_names_on_join"))
+ fe_channels_nicklist(channel, CHANNEL_NICKLIST_FLAG_ALL);
+}
+
static void cmd_wjoin_pre(const char *data)
{
GHashTable *optlist;
@@ -601,6 +607,7 @@ static void cmd_cycle(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
void fe_channels_init(void)
{
settings_add_bool("lookandfeel", "autoclose_windows", TRUE);
+ settings_add_bool("lookandfeel", "show_names_on_join", TRUE);
settings_add_int("lookandfeel", "names_max_columns", 6);
settings_add_int("lookandfeel", "names_max_width", 0);
@@ -608,6 +615,7 @@ void fe_channels_init(void)
signal_add("channel destroyed", (SIGNAL_FUNC) signal_channel_destroyed);
signal_add_last("window item changed", (SIGNAL_FUNC) signal_window_item_changed);
signal_add_last("server disconnected", (SIGNAL_FUNC) sig_disconnected);
+ signal_add("channel joined", (SIGNAL_FUNC) sig_channel_joined);
command_bind_first("join", NULL, (SIGNAL_FUNC) cmd_wjoin_pre);
command_bind("join", NULL, (SIGNAL_FUNC) cmd_join);
@@ -630,6 +638,7 @@ void fe_channels_deinit(void)
signal_remove("channel destroyed", (SIGNAL_FUNC) signal_channel_destroyed);
signal_remove("window item changed", (SIGNAL_FUNC) signal_window_item_changed);
signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected);
+ signal_remove("channel joined", (SIGNAL_FUNC) sig_channel_joined);
command_unbind("join", (SIGNAL_FUNC) cmd_wjoin_pre);
command_unbind("join", (SIGNAL_FUNC) cmd_join);
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c
index 7a82ea09..85a9af5a 100644
--- a/src/fe-common/irc/fe-events-numeric.c
+++ b/src/fe-common/irc/fe-events-numeric.c
@@ -68,12 +68,15 @@ static void event_ison(IRC_SERVER_REC *server, const char *data)
static void event_names_list(IRC_SERVER_REC *server, const char *data)
{
+ IRC_CHANNEL_REC *chanrec;
char *params, *channel, *names;
g_return_if_fail(data != NULL);
params = event_get_params(data, 4, NULL, NULL, &channel, &names);
- if (irc_channel_find(server, channel) == NULL) {
+
+ chanrec = irc_channel_find(server, channel);
+ if (chanrec == NULL || chanrec->names_got) {
printformat_module("fe-common/core", server, channel,
MSGLEVEL_CRAP, TXT_NAMES,
channel, 0, 0, 0, 0, 0);
@@ -83,19 +86,19 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
g_free(params);
}
-static void event_end_of_names(IRC_SERVER_REC *server, const char *data)
+static void event_end_of_names(IRC_SERVER_REC *server, const char *data,
+ const char *nick)
{
- char *params, *channel;
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);
- if (chanrec != NULL)
- fe_channels_nicklist(CHANNEL(chanrec),
- CHANNEL_NICKLIST_FLAG_ALL);
+ if (chanrec == NULL || chanrec->names_got)
+ print_event_received(server, data, nick, FALSE);
g_free(params);
}
@@ -878,7 +881,7 @@ void fe_events_numeric_init(void)
signal_add("event 221", (SIGNAL_FUNC) event_user_mode);
signal_add("event 303", (SIGNAL_FUNC) event_ison);
signal_add("event 353", (SIGNAL_FUNC) event_names_list);
- signal_add("event 366", (SIGNAL_FUNC) event_end_of_names);
+ signal_add_first("event 366", (SIGNAL_FUNC) event_end_of_names);
signal_add("event 352", (SIGNAL_FUNC) event_who);
signal_add("event 315", (SIGNAL_FUNC) event_end_of_who);
signal_add("event 271", (SIGNAL_FUNC) event_silence_list);