From d6da646d879a1b7f0ea2d09db2b266e3b6d0f3fa Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 29 Dec 2021 22:15:04 -0500 Subject: validate iso8601 when parsing to snowflake --- src/discord/discord.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/discord/discord.cpp') diff --git a/src/discord/discord.cpp b/src/discord/discord.cpp index 8c5ec93..7b0db38 100644 --- a/src/discord/discord.cpp +++ b/src/discord/discord.cpp @@ -1923,7 +1923,7 @@ void DiscordClient::HandleGatewayUserGuildSettingsUpdate(const GatewayMessage &m if (override.Muted) { if (override.MuteConfig.EndTime.has_value()) { const auto end = Snowflake::FromISO8601(*override.MuteConfig.EndTime); - if (end > now) + if (end.IsValid() && end > now) now_muted_channels.insert(override.ChannelID); } else { now_muted_channels.insert(override.ChannelID); @@ -2325,7 +2325,7 @@ void DiscordClient::HandleReadyGuildSettings(const ReadyEventData &data) { if (entry.Muted) { if (entry.MuteConfig.EndTime.has_value()) { const auto end = Snowflake::FromISO8601(*entry.MuteConfig.EndTime); - if (end > now) + if (end.IsValid() && end > now) m_muted_guilds.insert(entry.GuildID); } else { m_muted_guilds.insert(entry.GuildID); @@ -2335,7 +2335,7 @@ void DiscordClient::HandleReadyGuildSettings(const ReadyEventData &data) { if (override.Muted) { if (override.MuteConfig.EndTime.has_value()) { const auto end = Snowflake::FromISO8601(*override.MuteConfig.EndTime); - if (end > now) + if (end.IsValid() && end > now) m_muted_channels.insert(override.ChannelID); } else { m_muted_channels.insert(override.ChannelID); -- cgit v1.2.3