diff options
author | Sadie Powell <sadie@witchery.services> | 2024-03-11 13:53:05 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-03-11 19:17:29 +0000 |
commit | 29e7674e56bf2b829bba22def2760d034a76e788 (patch) | |
tree | f40049ba995b03dd7c510d88f9f19db2d2e65a2e /include/protocol.h | |
parent | e2df7d4d01f8fdb41c49ce8efc462cab005e7d5c (diff) |
Replace convertTo/stringify with non-throwing alternatives.
Having these throw is terrible for ergonomics and there are loads
of places where the exception was either silently ignored or not
handled at all. Having a function which returns an optional and
another that returns a default works a lot better imo.
Diffstat (limited to 'include/protocol.h')
-rw-r--r-- | include/protocol.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/protocol.h b/include/protocol.h index 88bb94bfc..612593c89 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -164,14 +164,14 @@ public: template <typename... Args> void SendMode(const MessageSource &source, Channel *chan, const Anope::string &modes, Args &&...args) { - SendModeInternal(source, chan, modes, { stringify(args)... }); + SendModeInternal(source, chan, modes, { Anope::ToString(args)... }); } virtual void SendModeInternal(const MessageSource &source, User *u, const Anope::string &modes, const std::vector<Anope::string> &values); template <typename... Args> void SendMode(const MessageSource &source, User *u, const Anope::string &modes, Args &&...args) { - SendModeInternal(source, u, modes, { stringify(args)... }); + SendModeInternal(source, u, modes, { Anope::ToString(args)... }); } /** Introduces a client to the rest of the network @@ -258,7 +258,7 @@ public: template <typename... Args> void SendNumeric(int numeric, const Anope::string &dest, Args &&...args) { - SendNumericInternal(numeric, dest, { stringify(args)... }); + SendNumericInternal(numeric, dest, { Anope::ToString(args)... }); } virtual void SendLogin(User *u, NickAlias *na) = 0; |