From d58d9fb4957168c134ae1e89005ff03154366a2a Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 26 Aug 2007 20:43:15 +0000 Subject: Add option to set invite announcements to nobody, ops only, or all users, based on options:announceinvites. Part of bug #386, should not be backported. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7837 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_invite.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/cmd_invite.cpp') diff --git a/src/cmd_invite.cpp b/src/cmd_invite.cpp index f4368071a..a6e82d281 100644 --- a/src/cmd_invite.cpp +++ b/src/cmd_invite.cpp @@ -78,8 +78,18 @@ CmdResult cmd_invite::Handle (const char** parameters, int pcnt, userrec *user) u->InviteTo(c->name); u->WriteFrom(user,"INVITE %s :%s",u->nick,c->name); user->WriteServ("341 %s %s %s",user->nick,u->nick,c->name); - if (ServerInstance->Config->AnnounceInvites) - c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick); + switch (ServerInstance->Config->AnnounceInvites) + { + case ServerConfig::INVITE_ANNOUNCE_ALL: + c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick); + break; + case ServerConfig::INVITE_ANNOUNCE_OPS: + c->WriteAllExceptSender(user, true, '@', "NOTICE %s :*** %s invited %s into the channel", c->name, user->nick, u->nick); + break; + default: + /* Nobody */ + break; + } FOREACH_MOD(I_OnUserInvite,OnUserInvite(user,u,c)); } else -- cgit v1.3.1-10-gc9f91