mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
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.
This commit is contained in:
parent
62cab9d662
commit
2502080871
@ -245,9 +245,18 @@ void channel_send_autocommands(CHANNEL_REC *channel)
|
|||||||
if (rec == NULL || rec->autosendcmd == NULL || !*rec->autosendcmd)
|
if (rec == NULL || rec->autosendcmd == NULL || !*rec->autosendcmd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (rec->botmasks == NULL || !*rec->botmasks) {
|
if (channel->wholist == FALSE) {
|
||||||
/* just send the command. */
|
/* if the autosendcmd alone (with no -bots parameter) has been
|
||||||
eval_special_string(rec->autosendcmd, "", channel->server, channel);
|
* 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,9 +25,11 @@
|
|||||||
void irc_channels_setup_init(void)
|
void irc_channels_setup_init(void)
|
||||||
{
|
{
|
||||||
signal_add("channel wholist", (SIGNAL_FUNC) channel_send_autocommands);
|
signal_add("channel wholist", (SIGNAL_FUNC) channel_send_autocommands);
|
||||||
|
signal_add("channel joined", (SIGNAL_FUNC) channel_send_autocommands);
|
||||||
}
|
}
|
||||||
|
|
||||||
void irc_channels_setup_deinit(void)
|
void irc_channels_setup_deinit(void)
|
||||||
{
|
{
|
||||||
signal_remove("channel wholist", (SIGNAL_FUNC) channel_send_autocommands);
|
signal_remove("channel wholist", (SIGNAL_FUNC) channel_send_autocommands);
|
||||||
|
signal_remove("channel joined", (SIGNAL_FUNC) channel_send_autocommands);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user