]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
option to allow announce of invites to channel (similar to unreal)
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 8 Mar 2007 11:26:31 +0000 (11:26 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 8 Mar 2007 11:26:31 +0000 (11:26 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6635 e03df62e-2008-0410-955e-edbf42e46eb7

include/configreader.h
include/modules.h
src/cmd_invite.cpp
src/configreader.cpp

index 0de57c4e4862b622166b9c6dace9a01a5cfc2947..9e0016bee92f80a6655e51f9053eebdae0af3dde 100644 (file)
@@ -395,6 +395,10 @@ class ServerConfig : public Extensible
         */
        bool HideBans;
 
+       /** Announce invites to the channel with a server notice
+        */
+       bool AnnounceInvites;
+
        /** If this is enabled then operators will
         * see invisible (+i) channels in /whois.
         */
index 59d777b715dad032ec5f983d36476a20a4d89586..e90c66fe98dbae3f736120ba217bfbab710f94b3 100644 (file)
@@ -75,7 +75,7 @@ enum MessageType {
  * ipv4 servers, so this value will be ten times as
  * high on ipv6 servers.
  */
-#define NATIVE_API_VERSION 11015
+#define NATIVE_API_VERSION 11016
 #ifdef IPV6
 #define API_VERSION (NATIVE_API_VERSION * 10)
 #else
index 88b64f03dc00627563619369b34b0e77c5ecaafc..2910aca3fe56d647960e2c1c7867a86d922e7fa7 100644 (file)
@@ -74,10 +74,11 @@ CmdResult cmd_invite::Handle (const char** parameters, int pcnt, userrec *user)
                        return CMD_FAILURE;
                }
 
-               irc::string xname(c->name);
-               u->InviteTo(xname);
+               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, "%s invited %s into the channel", user->nick, u->nick)
                FOREACH_MOD(I_OnUserInvite,OnUserInvite(user,u,c));
        }
        else
index 9d920dc8cdee93e23ea476668f7e5f327ef7650c..1d4908f7acad9c7f87ae81fc5bf78e7059cc942b 100644 (file)
@@ -590,6 +590,7 @@ void ServerConfig::Read(bool bail, userrec* user)
                {"options",     "syntaxhints",  "0",                    new ValueContainerBool (&this->SyntaxHints),            DT_BOOLEAN, NoValidation},
                {"options",     "cyclehosts",   "0",                    new ValueContainerBool (&this->CycleHosts),             DT_BOOLEAN, NoValidation},
                {"options",     "ircumsgprefix","0",                    new ValueContainerBool (&this->UndernetMsgPrefix),      DT_BOOLEAN, NoValidation},
+               {"options",     "announceinvites", "1",                 new ValueContainerBool (&this->AnnounceInvites),        DT_BOOLEAN, NoValidation},
                {"options",     "hostintopic",  "1",                    new ValueContainerBool (&this->FullHostInTopic),        DT_BOOLEAN, NoValidation},
                {"pid",         "file",         "",                     new ValueContainerChar (this->PID),                     DT_CHARPTR, NoValidation},
                {"whowas",      "groupsize",    "10",                   new ValueContainerInt  (&this->WhoWasGroupSize),        DT_INTEGER, NoValidation},