summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/inspircd.conf.example10
-rw-r--r--include/configreader.h2
-rw-r--r--src/cmd_invite.cpp6
-rw-r--r--src/configreader.cpp2
4 files changed, 18 insertions, 2 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example
index ce0432220..e1b33565b 100644
--- a/docs/inspircd.conf.example
+++ b/docs/inspircd.conf.example
@@ -864,6 +864,14 @@
# this to 'ops' and to announce to all users set the #
# value to 'all'. #
# #
+# The value 'dynamic' varies between 'ops' and 'all' #
+# settings depending on if the channel is +i or not. #
+# When the channel is +i, messages go only to ops, #
+# and when the channel is not +i, messages go to #
+# everyone. In short, the messages will go to every #
+# user who has power of INVITE on the channel. This #
+# is the recommended setting. #
+# #
# disablehmac - If you are linking your InspIRCd to older versions #
# then you can specify this option and set it to #
# yes. 1.1.6 and above support HMAC and challenge- #
@@ -950,7 +958,7 @@
serverpingfreq="60"
allowhalfop="yes"
defaultmodes="nt"
- announceinvites="all"
+ announceinvites="dynamic"
moronbanner="You're banned! Email haha@abuse.com with the ERROR line below for help."
exemptchanops="">
diff --git a/include/configreader.h b/include/configreader.h
index 703c28414..4a9720862 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -240,7 +240,7 @@ class CoreExport ServerConfig : public Extensible
public:
/** Used to indicate who we announce invites to on a channel */
- enum InviteAnnounceState { INVITE_ANNOUNCE_NONE, INVITE_ANNOUNCE_ALL, INVITE_ANNOUNCE_OPS };
+ enum InviteAnnounceState { INVITE_ANNOUNCE_NONE, INVITE_ANNOUNCE_ALL, INVITE_ANNOUNCE_OPS, INVITE_ANNOUNCE_DYNAMIC };
/** Pointer to function that validates dns server addresses (can be changed depending on platform) */
Validator DNSServerValidator;
diff --git a/src/cmd_invite.cpp b/src/cmd_invite.cpp
index a6e82d281..72902998c 100644
--- a/src/cmd_invite.cpp
+++ b/src/cmd_invite.cpp
@@ -86,6 +86,12 @@ CmdResult cmd_invite::Handle (const char** parameters, int pcnt, userrec *user)
case ServerConfig::INVITE_ANNOUNCE_OPS:
c->WriteAllExceptSender(user, true, '@', "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick);
break;
+ case ServerConfig::INVITE_ANNOUNCE_DYNAMIC:
+ if (c->IsModeSet('i'))
+ c->WriteAllExceptSender(user, true, '@', "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick);
+ else
+ c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick);
+ break;
default:
/* Nobody */
break;
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 06a86a775..a22e0c620 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -361,6 +361,8 @@ bool ValidateInvite(ServerConfig* conf, const char* tag, const char* value, Valu
conf->AnnounceInvites = ServerConfig::INVITE_ANNOUNCE_OPS;
else if (v == "all")
conf->AnnounceInvites = ServerConfig::INVITE_ANNOUNCE_ALL;
+ else if (v == "dynamic")
+ conf->AnnounceInvites = ServerConfig::INVITE_ANNOUNCE_DYNAMIC;
else
conf->AnnounceInvites = ServerConfig::INVITE_ANNOUNCE_NONE;