diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-04-01 15:22:54 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-04-01 15:22:54 +0000 |
commit | e466a6f5fef9aa5cb0ac4621fd578edbace88281 (patch) | |
tree | 5f3bfc33613625ac7775a46bd52c234dda8369af | |
parent | c72736a6eb41a434680da033653414175fc1ca9a (diff) |
Add <options:fixedquit> and <options:suffixquit> to go along with the existing <options:prefixquit>. note that fixedquit overrides both suffix and prefix if set
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6722 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | docs/inspircd.conf.example | 13 | ||||
-rw-r--r-- | include/configreader.h | 8 | ||||
-rw-r--r-- | src/cmd_quit.cpp | 9 | ||||
-rw-r--r-- | src/configreader.cpp | 6 |
4 files changed, 31 insertions, 5 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example index 5ff06c811..d1288aecd 100644 --- a/docs/inspircd.conf.example +++ b/docs/inspircd.conf.example @@ -647,7 +647,15 @@ # # # Settings to define which features are useable on your server. # # # -# prefixquit - a prefix for a client's quit message # +# prefixquit - A prefix to be placed on the start of a client's # +# quit message # +# # +# suffixquit - A suffix to be placed on the end of a client's # +# quit message. # +# # +# fixedquit - A fixed quit message to display for all client # +# QUITS. If specified, overrides both prefixquit # +# and suffixquit options. # # # # loglevel - specifies what detail of messages to log in the # # log file. You may select from debug, verbose, # @@ -785,7 +793,8 @@ # nick!user@host is shown for who set a TOPIC last. # # if set to no, then only the nickname is shown. # # # -#announceinvites - If this option is set to yes (the default), then # +# announceinvites # +# - If this option is set to yes (the default), then # # invites are announced to the channel when a user # # invites annother user. If you consider this to be # # unnecessary noise, explicitly set this to no. # diff --git a/include/configreader.h b/include/configreader.h index 9e0016bee..2d144441a 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -276,6 +276,14 @@ class ServerConfig : public Extensible */ char PrefixQuit[MAXBUF]; + /** The quit suffix in use, or an empty string + */ + char SuffixQuit[MAXBUF]; + + /** The fixed quit message in use, or an empty string + */ + char FixedQuit[MAXBUF]; + /** The last string found within a <die> tag, or * an empty string. */ diff --git a/src/cmd_quit.cpp b/src/cmd_quit.cpp index 5c5abf7ba..5e2c023b7 100644 --- a/src/cmd_quit.cpp +++ b/src/cmd_quit.cpp @@ -30,7 +30,14 @@ CmdResult cmd_quit::Handle (const char** parameters, int pcnt, userrec *user) std::string quitmsg; if (IS_LOCAL(user)) - quitmsg = pcnt ? ServerInstance->Config->PrefixQuit + std::string(parameters[0]) : "Client exited"; + { + if (*ServerInstance->Config->FixedQuit) + quitmsg = ServerInstance->Config->FixedQuit; + else + quitmsg = pcnt ? + ServerInstance->Config->PrefixQuit + std::string(parameters[0]) + ServerInstance->Config->SuffixQuit + : "Client exited"; + } else quitmsg = pcnt ? parameters[0] : "Client exited"; diff --git a/src/configreader.cpp b/src/configreader.cpp index 1d4908f7a..315c1eb08 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -25,9 +25,9 @@ ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance) { this->ClearStack(); *ServerName = *Network = *ServerDesc = *AdminName = '\0'; - *HideWhoisServer = *AdminEmail = *AdminNick = *diepass = *restartpass = '\0'; + *HideWhoisServer = *AdminEmail = *AdminNick = *diepass = *restartpass = *FixedQuit = '\0'; *CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0'; - *UserStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0'; + *UserStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = *SuffixQuit = '\0'; WhoWasGroupSize = WhoWasMaxGroups = WhoWasMaxKeep = 0; log_file = NULL; NoUserDns = forcedebug = OperSpyWhois = nofork = HideBans = HideSplits = UndernetMsgPrefix = false; @@ -572,6 +572,8 @@ void ServerConfig::Read(bool bail, userrec* user) {"power", "pause", "", new ValueContainerInt (&this->DieDelay), DT_INTEGER, NoValidation}, {"power", "restartpass", "", new ValueContainerChar (this->restartpass), DT_CHARPTR, NoValidation}, {"options", "prefixquit", "", new ValueContainerChar (this->PrefixQuit), DT_CHARPTR, NoValidation}, + {"options", "suffixquit", "", new ValueContainerChar (this->SuffixQuit), DT_CHARPTR, NoValidation}, + {"options", "fixedquit", "", new ValueContainerChar (this->FixedQuit), DT_CHARPTR, NoValidation}, {"options", "loglevel", "default", new ValueContainerChar (debug), DT_CHARPTR, ValidateLogLevel}, {"options", "netbuffersize","10240", new ValueContainerInt (&this->NetBufferSize), DT_INTEGER, ValidateNetBufferSize}, {"options", "maxwho", "128", new ValueContainerInt (&this->MaxWhoResults), DT_INTEGER, ValidateMaxWho}, |