X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/c7561f03ef5802a0ccb10c49788cc21bcaa45e06..4d12e65469c877f8028d5ac40a39457ec96b2f40:/extensions/invite_notify.c diff --git a/extensions/invite_notify.c b/extensions/invite_notify.c index bc7c84f7..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"; @@ -13,7 +14,7 @@ static void m_invited(struct MsgBuf *, struct Client *, struct Client *, int, co static unsigned int CAP_INVITE_NOTIFY; mapi_hfn_list_av1 inv_notify_hfnlist[] = { - { "invite", hook_invite }, + { "invite", hook_invite, HOOK_MONITOR }, { NULL, NULL } }; @@ -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