From 22b81a325d96ed09683549fc007a2998ff0afa9d Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 13 Dec 2018 02:14:51 +0100 Subject: [PATCH] Add another workaround for Steam fuckups --- ArchiSteamFarm/Bot.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 74bb7307e..95fdfe30a 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -1762,7 +1762,8 @@ namespace ArchiSteamFarm { return; } - if ((notification.steamid_sender != SteamID) && BotConfig.BotBehaviour.HasFlag(BotConfig.EBotBehaviour.MarkReceivedMessagesAsRead)) { + // Under normal circumstances, timestamp must always be greater than 0, but Steam already proved that it's capable of going against the logic + if ((notification.steamid_sender != SteamID) && (notification.timestamp > 0) && BotConfig.BotBehaviour.HasFlag(BotConfig.EBotBehaviour.MarkReceivedMessagesAsRead)) { Utilities.InBackground(() => ArchiHandler.AckChatMessage(notification.chat_group_id, notification.chat_id, notification.timestamp)); } @@ -1800,7 +1801,8 @@ namespace ArchiSteamFarm { return; } - if (!notification.local_echo && BotConfig.BotBehaviour.HasFlag(BotConfig.EBotBehaviour.MarkReceivedMessagesAsRead)) { + // Under normal circumstances, timestamp must always be greater than 0, but Steam already proved that it's capable of going against the logic + if (!notification.local_echo && (notification.rtime32_server_timestamp > 0) && BotConfig.BotBehaviour.HasFlag(BotConfig.EBotBehaviour.MarkReceivedMessagesAsRead)) { Utilities.InBackground(() => ArchiHandler.AckMessage(notification.steamid_friend, notification.rtime32_server_timestamp)); }