summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/conf/inspircd.conf.example12
-rw-r--r--src/helperfuncs.cpp27
2 files changed, 26 insertions, 13 deletions
diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example
index e28319a69..b5671ee6b 100644
--- a/docs/conf/inspircd.conf.example
+++ b/docs/conf/inspircd.conf.example
@@ -313,6 +313,18 @@
# Alternate MOTD file for this connect class. The contents of this file are
# specified using <files secretmotd="filename"> or <execfiles ...>
+ #
+ # NOTE: the following escape sequences for IRC formatting characters can be
+ # used in your MOTD:
+ # Bold: \b
+ # Color: \c<fg>[,<bg>]
+ # Italic: \i
+ # Monospace: \m (not widely supported)
+ # Reset: \x
+ # Strikethrough: \s (not widely supported)
+ # Underline: \u
+ # See https://defs.ircdocs.horse/info/formatting.html for more information
+ # on client support for formatting characters.
motd="secretmotd"
# port: What port range this user is allowed to connect on. (optional)
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index e331ba9dc..111e1363f 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -146,19 +146,20 @@ void InspIRCd::ProcessColors(file_cache& input)
{
std::string character;
std::string replace;
- special_chars(const std::string &c, const std::string &r) : character(c), replace(r) { }
- }
-
- special[] = {
- special_chars("\\002", "\002"), // Bold
- special_chars("\\037", "\037"), // underline
- special_chars("\\003", "\003"), // Color
- special_chars("\\017", "\017"), // Stop colors
- special_chars("\\u", "\037"), // Alias for underline
- special_chars("\\b", "\002"), // Alias for Bold
- special_chars("\\x", "\017"), // Alias for stop
- special_chars("\\c", "\003"), // Alias for color
- special_chars("", "")
+ special_chars(const std::string& c, const std::string& r)
+ : character(c)
+ , replace(r)
+ {
+ }
+ } special[] = {
+ special_chars("\\b", "\x02"), // Bold
+ special_chars("\\c", "\x03"), // Color
+ special_chars("\\i", "\x1D"), // Italic
+ special_chars("\\m", "\x11"), // Monospace
+ special_chars("\\s", "\x1E"), // Strikethrough
+ special_chars("\\u", "\x1F"), // Underline
+ special_chars("\\x", "\x0F"), // Reset
+ special_chars("\\", "")
};
for(file_cache::iterator it = input.begin(), it_end = input.end(); it != it_end; it++)