From d7bc663d0ad571697f0a022f82aeb4ad3c23cc2b Mon Sep 17 00:00:00 2001 From: peavey Date: Sat, 16 Dec 2006 22:43:56 +0000 Subject: Config option added for prefixed channel NOTICEs and PRIVMSGs to turn on/off IRCU style of adding prefix to outgoing text. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6018 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_notice.cpp | 10 ++++++++-- src/cmd_privmsg.cpp | 9 ++++++++- src/configreader.cpp | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/cmd_notice.cpp b/src/cmd_notice.cpp index 69ca44918..df0e518b0 100644 --- a/src/cmd_notice.cpp +++ b/src/cmd_notice.cpp @@ -79,7 +79,6 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user) return CMD_FAILURE; } } - int MOD_RESULT = 0; std::string temp = parameters[1]; @@ -97,7 +96,14 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user) if (status) { - chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %c%s :%c %s", status, chan->name, status, parameters[1]); + if (ServerInstance->Config->UndernetMsgPrefix) + { + chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %c%s :%c %s", status, chan->name, status, parameters[1]); + } + else + { + chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %c%s :%s", status, chan->name, parameters[1]); + } } else { diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp index b12165670..abf46814a 100644 --- a/src/cmd_privmsg.cpp +++ b/src/cmd_privmsg.cpp @@ -98,7 +98,14 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) if (status) { - chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%c %s", status, chan->name, status, parameters[1]); + if (ServerInstance->Config->UndernetMsgPrefix) + { + chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%c %s", status, chan->name, status, parameters[1]); + } + else + { + chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%s", status, chan->name, parameters[1]); + } } else { diff --git a/src/configreader.cpp b/src/configreader.cpp index 8e2aa497f..682dbeb38 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -659,6 +659,7 @@ void ServerConfig::Read(bool bail, userrec* user) {"options", "nouserdns", new ValueContainerBool (&this->NoUserDns), DT_BOOLEAN, NoValidation}, {"options", "syntaxhints", new ValueContainerBool (&this->SyntaxHints), DT_BOOLEAN, NoValidation}, {"options", "cyclehosts", new ValueContainerBool (&this->CycleHosts), DT_BOOLEAN, NoValidation}, + {"options", "ircumsgprefix", new ValueContainerBool (&this->UndernetMsgPrefix), DT_BOOLEAN, NoValidation}, {"pid", "file", new ValueContainerChar (this->PID), DT_CHARPTR, NoValidation}, {"whowas", "groupsize", new ValueContainerInt (&this->WhoWasGroupSize), DT_INTEGER, NoValidation}, {"whowas", "maxgroups", new ValueContainerInt (&this->WhoWasMaxGroups), DT_INTEGER, NoValidation}, -- cgit v1.2.3