mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
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
This commit is contained in:
parent
82a6407634
commit
55b4ae92b8
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user