diff options
Diffstat (limited to 'src/protocol.cpp')
-rw-r--r-- | src/protocol.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp index 5699a2d48..55603c8e7 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -86,6 +86,14 @@ Anope::string IRCDProto::SID_Retrieve() return current_sid; } +time_t IRCDProto::ExtractTimestamp(const Anope::string &str) +{ + auto ts = Anope::TryConvert<time_t>(str); + if (!ts.has_value()) + throw ProtocolException("Invalid timestamp: " + str); + return ts.value(); +} + void IRCDProto::SendError(const Anope::string &reason) { Uplink::Send("ERROR", reason); |