From 53849b1106c4d3083d05c7316a1bc53af5a1bbb4 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Wed, 6 Nov 2019 20:25:32 +0100 Subject: [PATCH] Kill MarkTradeMessagesAsRead --- ArchiSteamFarm/Bot.cs | 20 +++----------------- ArchiSteamFarm/BotConfig.cs | 3 +-- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 49cb78613..8bb7ec8d7 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -2203,7 +2203,7 @@ namespace ArchiSteamFarm { // 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)) { - if (ShouldAckGroupChatMessage(notification.steamid_sender)) { + if (ShouldAckChatMessage(notification.steamid_sender)) { Utilities.InBackground(() => ArchiHandler.AckChatMessage(notification.chat_group_id, notification.chat_id, notification.timestamp)); } } @@ -2245,7 +2245,7 @@ namespace ArchiSteamFarm { // 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)) { - if (ShouldAckPrivateChatMessage(notification.steamid_friend, notification.message)) { + if (ShouldAckChatMessage(notification.steamid_friend)) { Utilities.InBackground(() => ArchiHandler.AckMessage(notification.steamid_friend, notification.rtime32_server_timestamp)); } } @@ -2928,7 +2928,7 @@ namespace ArchiSteamFarm { StopPlayingWasBlockedTimer(); } - private bool ShouldAckGroupChatMessage(ulong steamID) { + private bool ShouldAckChatMessage(ulong steamID) { if ((steamID == 0) || !new SteamID(steamID).IsIndividualAccount) { ArchiLogger.LogNullError(nameof(steamID)); @@ -2942,20 +2942,6 @@ namespace ArchiSteamFarm { return BotConfig.BotBehaviour.HasFlag(BotConfig.EBotBehaviour.MarkBotMessagesAsRead) && Bots.Values.Any(bot => bot.SteamID == steamID); } - private bool ShouldAckPrivateChatMessage(ulong steamID, string message) { - if ((steamID == 0) || !new SteamID(steamID).IsIndividualAccount || string.IsNullOrEmpty(message)) { - ArchiLogger.LogNullError(nameof(steamID) + " || " + nameof(message)); - - return false; - } - - if (ShouldAckGroupChatMessage(steamID)) { - return true; - } - - return BotConfig.BotBehaviour.HasFlag(BotConfig.EBotBehaviour.MarkTradeMessagesAsRead) && message.StartsWith("[tradeoffer", StringComparison.Ordinal); - } - private void StopConnectionFailureTimer() { if (ConnectionFailureTimer == null) { return; diff --git a/ArchiSteamFarm/BotConfig.cs b/ArchiSteamFarm/BotConfig.cs index dadfe7dc9..a83e1904c 100644 --- a/ArchiSteamFarm/BotConfig.cs +++ b/ArchiSteamFarm/BotConfig.cs @@ -387,8 +387,7 @@ namespace ArchiSteamFarm { DismissInventoryNotifications = 8, MarkReceivedMessagesAsRead = 16, MarkBotMessagesAsRead = 32, - MarkTradeMessagesAsRead = 64, - All = RejectInvalidFriendInvites | RejectInvalidTrades | RejectInvalidGroupInvites | DismissInventoryNotifications | MarkReceivedMessagesAsRead | MarkBotMessagesAsRead | MarkTradeMessagesAsRead + All = RejectInvalidFriendInvites | RejectInvalidTrades | RejectInvalidGroupInvites | DismissInventoryNotifications | MarkReceivedMessagesAsRead | MarkBotMessagesAsRead } public enum EFarmingOrder : byte {