diff options
| author | 2021-01-07 13:13:58 +0000 | |
|---|---|---|
| committer | 2021-01-07 13:13:58 +0000 | |
| commit | 4f68d162cc55a8e35f9800a2ab85274876061861 (patch) | |
| tree | 8de0f196ab3447614a6481f9b356e5dc2bae5a27 /include | |
| parent | Add a function for shrinking module names. (diff) | |
| parent | Implement support for more XML and IRC colour code escapes. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'include')
| -rw-r--r-- | include/configparser.h | 22 | ||||
| -rw-r--r-- | include/event.h | 4 | ||||
| -rw-r--r-- | include/numerics.h | 1 |
3 files changed, 23 insertions, 4 deletions
diff --git a/include/configparser.h b/include/configparser.h index 6a5428b13..e88d3039d 100644 --- a/include/configparser.h +++ b/include/configparser.h @@ -33,9 +33,27 @@ struct ParseStack ParseStack(ServerConfig* conf) : output(conf->config_data), FilesOutput(conf->Files), errstr(conf->errstr) { - vars["amp"] = "&"; + // Special character escapes. + vars["newline"] = "\n"; + vars["nl"] = "\n"; + + // XML escapes. + vars["amp"] = "&"; + vars["apos"] = "'"; + vars["gt"] = ">"; + vars["lt"] = "<"; vars["quot"] = "\""; - vars["newline"] = vars["nl"] = "\n"; + + // IRC formatting codes. + vars["irc.bold"] = "\x02"; + vars["irc.color"] = "\x03"; + vars["irc.colour"] = "\x03"; + vars["irc.italic"] = "\x1D"; + vars["irc.monospace"] = "\x11"; + vars["irc.reset"] = "\x0F"; + vars["irc.reverse"] = "\x16"; + vars["irc.strikethrough"] = "\x1E"; + vars["irc.underline"] = "\x1F"; } bool ParseFile(const std::string& name, int flags, const std::string& mandatory_tag = std::string(), bool isexec = false); void DoInclude(std::shared_ptr<ConfigTag> includeTag, int flags); diff --git a/include/event.h b/include/event.h index 9a41b3fef..03c8b9d05 100644 --- a/include/event.h +++ b/include/event.h @@ -194,7 +194,7 @@ inline bool Events::ModuleEventProvider::ElementComp::operator()(Events::ModuleE template<typename Class, typename... FunArgs, typename... FwdArgs> inline void Events::ModuleEventProvider::Call(void (Class::*function)(FunArgs...), FwdArgs&&... args) const { - if (!GetModule() || GetModule()->dying) + if (GetModule() && GetModule()->dying) return; for (const auto& subscriber : subscribers) @@ -211,7 +211,7 @@ inline void Events::ModuleEventProvider::Call(void (Class::*function)(FunArgs... template<typename Class, typename... FunArgs, typename... FwdArgs> inline ModResult Events::ModuleEventProvider::FirstResult(ModResult (Class::*function)(FunArgs...), FwdArgs&&... args) const { - if (!GetModule() || GetModule()->dying) + if (GetModule() && GetModule()->dying) return MOD_RES_PASSTHRU; ModResult result; diff --git a/include/numerics.h b/include/numerics.h index a882dd560..8d07259d6 100644 --- a/include/numerics.h +++ b/include/numerics.h @@ -49,6 +49,7 @@ enum RPL_MAP = 15, // ircu RPL_ENDMAP = 17, // ircu RPL_MAPUSERS = 18, // insp-specific + RPL_SAVENICK = 43, // From irc2. RPL_STATS = 210, // From aircd. RPL_UMODEIS = 221, |
