diff --git a/doc/ircd.conf.example b/doc/ircd.conf.example index ff3f549d..a3c03984 100644 --- a/doc/ircd.conf.example +++ b/doc/ircd.conf.example @@ -371,6 +371,7 @@ channel { displayed_usercount = 3; strip_topic_colors = no; opmod_send_statusmsg = no; + invite_notify_notice = yes; }; serverhide { diff --git a/doc/reference.conf b/doc/reference.conf index 58b5fed1..b6eda7fd 100644 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -815,6 +815,11 @@ channel { /* ip_bans_through_vhost: should channel IP bans see through dynamic spoofed hosts? */ ip_bans_through_vhost = yes; + + /* invite_notify_notice: when using extensions/invite_notify, should + * we send a NOTICE to clients that don't support IRCv3 invite-notify + */ + invite_notify_notice = yes; }; diff --git a/extensions/invite_notify.c b/extensions/invite_notify.c index 19708f90..96e13f68 100644 --- a/extensions/invite_notify.c +++ b/extensions/invite_notify.c @@ -4,6 +4,7 @@ #include #include #include +#include #include static const char inv_notify_desc[] = "Notifies channel on /invite and provides the invite-notify client capability"; @@ -32,12 +33,16 @@ mapi_clist_av1 inv_notify_clist[] = { &invited_msgtab, NULL }; static void invite_notify(struct Client *source, struct Client *target, struct Channel *channel) { - sendto_channel_local_with_capability(source, CHFL_CHANOP, 0, CAP_INVITE_NOTIFY, channel, - ":%s NOTICE %s :%s is inviting %s to %s.", - me.name, channel->chname, source->name, target->name, channel->chname); sendto_channel_local_with_capability(source, CHFL_CHANOP, CAP_INVITE_NOTIFY, 0, channel, ":%s!%s@%s INVITE %s %s", source->name, source->username, source->host, target->name, channel->chname); + + if (!ConfigChannel.invite_notify_notice) + return; + + sendto_channel_local_with_capability(source, CHFL_CHANOP, 0, CAP_INVITE_NOTIFY, channel, + ":%s NOTICE %s :%s is inviting %s to %s.", + me.name, channel->chname, source->name, target->name, channel->chname); } static void diff --git a/include/s_conf.h b/include/s_conf.h index 53233ee1..cd50de43 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -297,6 +297,7 @@ struct config_channel_entry int strip_topic_colors; int opmod_send_statusmsg; int ip_bans_through_vhost; + int invite_notify_notice; }; struct config_server_hide diff --git a/ircd/newconf.c b/ircd/newconf.c index 33bfd4d1..55a474d4 100644 --- a/ircd/newconf.c +++ b/ircd/newconf.c @@ -2821,6 +2821,7 @@ static struct ConfEntry conf_channel_table[] = { "strip_topic_colors", CF_YESNO, NULL, 0, &ConfigChannel.strip_topic_colors }, { "opmod_send_statusmsg", CF_YESNO, NULL, 0, &ConfigChannel.opmod_send_statusmsg }, { "ip_bans_through_vhost", CF_YESNO, NULL, 0, &ConfigChannel.ip_bans_through_vhost }, + { "invite_notify_notice", CF_YESNO, NULL, 0, &ConfigChannel.invite_notify_notice }, { "\0", 0, NULL, 0, NULL } }; diff --git a/ircd/s_conf.c b/ircd/s_conf.c index dadaf7a4..87f18785 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -829,7 +829,8 @@ set_default_conf(void) ConfigChannel.disable_local_channels = false; ConfigChannel.displayed_usercount = 3; ConfigChannel.opmod_send_statusmsg = false; - ConfigChannel.ip_bans_through_vhost= true; + ConfigChannel.ip_bans_through_vhost = true; + ConfigChannel.invite_notify_notice = true; ConfigChannel.autochanmodes = MODE_TOPICLIMIT | MODE_NOPRIVMSGS; diff --git a/modules/m_info.c b/modules/m_info.c index 6742bafb..c2096c4e 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -636,6 +636,11 @@ static struct InfoStruct info_table[] = { "Channel IP bans see through dynamic spoofs", INFO_INTBOOL_YN(&ConfigChannel.ip_bans_through_vhost), }, + { + "invite_notify_notice", + "NOTICEs are sent to clients that do not support invite-notify", + INFO_INTBOOL_YN(&ConfigChannel.invite_notify_notice), + }, { "hide_opers", "Hide all opers from unprivileged users",