summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/inspircd.conf.example6
-rw-r--r--include/configreader.h5
-rw-r--r--src/cmd_notice.cpp10
-rw-r--r--src/cmd_privmsg.cpp9
-rw-r--r--src/configreader.cpp1
5 files changed, 28 insertions, 3 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example
index 9d5434f1b..14e7d6b11 100644
--- a/docs/inspircd.conf.example
+++ b/docs/inspircd.conf.example
@@ -741,6 +741,11 @@
# new TS values in the timestamp. If you think this #
# is just pointless noise, define the value to 0. #
# #
+# ircumsgprefix - Use undernet style message prefix for channel #
+# NOTICE and PRIVMSG adding the prefix to the line #
+# of text sent out. Eg. NOTICE @#test :@ testing #
+# vs off: NOTICE @#test :testing #
+#
# notimesync - If this value is 'yes', 'true', or '1', time #
# synchronization is disabled on this server. This #
# means any servers you are linked to will not #
@@ -771,6 +776,7 @@
nouserdns="no"
syntaxhints="no"
cyclehosts="yes"
+ ircumsgprefix="no"
announcets="yes"
notimesync="no"
allowhalfop="yes">
diff --git a/include/configreader.h b/include/configreader.h
index 98a13034d..8416b12bf 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -492,6 +492,11 @@ class ServerConfig : public Extensible
*/
bool CycleHosts;
+ /** If set to true, prefixed channel NOTICEs and PRIVMSGs will have the prefix
+ * added to the outgoing text for undernet style msg prefixing.
+ */
+ bool UndernetMsgPrefix;
+
/** All oper type definitions from the config file
*/
opertype_t opertypes;
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},