diff options
author | LemonBoy <thatlemon@gmail.com> | 2016-01-14 23:54:42 +0100 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2016-01-14 23:54:42 +0100 |
commit | 25020808710f359e75a85a5252bf0f72443d09ee (patch) | |
tree | 012fe442b6543bc2c89189acddad6b993e2043e2 /src | |
parent | 62cab9d662d7f8875de8ee186cbbe4ea6cb891cd (diff) | |
download | irssi-25020808710f359e75a85a5252bf0f72443d09ee.zip |
Change when the autocmds are sent.
As per #175 if a -botcmd is specified for a given channel without a
-bots parameter then the command is sent right after joining the
channel.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/channels.c | 15 | ||||
-rw-r--r-- | src/irc/core/irc-channels-setup.c | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/core/channels.c b/src/core/channels.c index 9af8b844..bfde605e 100644 --- a/src/core/channels.c +++ b/src/core/channels.c @@ -245,9 +245,18 @@ void channel_send_autocommands(CHANNEL_REC *channel) if (rec == NULL || rec->autosendcmd == NULL || !*rec->autosendcmd) return; - if (rec->botmasks == NULL || !*rec->botmasks) { - /* just send the command. */ - eval_special_string(rec->autosendcmd, "", channel->server, channel); + if (channel->wholist == FALSE) { + /* if the autosendcmd alone (with no -bots parameter) has been + * specified then send it right after joining the channel, when + * the WHO list hasn't been yet retrieved. + * Depending on the value of the 'channel_max_who_sync' option + * the WHO list might not be retrieved after the join event. */ + + if (rec->botmasks == NULL || !*rec->botmasks) { + /* just send the command. */ + eval_special_string(rec->autosendcmd, "", channel->server, channel); + } + return; } diff --git a/src/irc/core/irc-channels-setup.c b/src/irc/core/irc-channels-setup.c index 2320352d..be69ad63 100644 --- a/src/irc/core/irc-channels-setup.c +++ b/src/irc/core/irc-channels-setup.c @@ -25,9 +25,11 @@ void irc_channels_setup_init(void) { signal_add("channel wholist", (SIGNAL_FUNC) channel_send_autocommands); + signal_add("channel joined", (SIGNAL_FUNC) channel_send_autocommands); } void irc_channels_setup_deinit(void) { signal_remove("channel wholist", (SIGNAL_FUNC) channel_send_autocommands); + signal_remove("channel joined", (SIGNAL_FUNC) channel_send_autocommands); } |