summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-26 21:15:47 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-26 21:15:47 +0000
commit9cd8fe39d58be851d09564ab7f9c5e64fa4e58e5 (patch)
tree2865f46e98d0b3cccf50950f70945313ab8a9d41 /src
parent035c7089ccc9973ad52aa284b972e6c65cc1bab7 (diff)
Added new announceinvite setting i discussed briefly with w00t and i like myself:
# 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. # git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7841 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/cmd_invite.cpp6
-rw-r--r--src/configreader.cpp2
2 files changed, 8 insertions, 0 deletions
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;