mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-10 21:54:23 +00:00
Never handle friend message when running in offline mode
This is ridiculous how I've just reverted workaround of one thing only to find out another one needs fix. How do we even get a freaking message if we're set as offline? Did they even fix the problem CORRECTLY? Because I don't think so.
This commit is contained in:
@@ -1460,6 +1460,10 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
if (BotConfig.FarmOffline) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (callback.EntryType != EChatEntryType.ChatMsg) {
|
||||
return;
|
||||
}
|
||||
@@ -1480,10 +1484,7 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
ArchiLogger.LogGenericDebug("Triggered");
|
||||
|
||||
if (callback.Messages.Count == 0) {
|
||||
ArchiLogger.LogGenericDebug("No messages");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1492,22 +1493,18 @@ namespace ArchiSteamFarm {
|
||||
|
||||
// If message is read already, return
|
||||
if (!lastMessage.Unread) {
|
||||
ArchiLogger.LogGenericDebug("Last message read already");
|
||||
return;
|
||||
}
|
||||
|
||||
// If message is too old, return
|
||||
if (DateTime.UtcNow.Subtract(lastMessage.Timestamp).TotalHours > 1) {
|
||||
ArchiLogger.LogGenericDebug("Last message too old");
|
||||
return;
|
||||
}
|
||||
|
||||
ArchiLogger.LogGenericTrace(callback.SteamID.ConvertToUInt64() + ": " + lastMessage.Message);
|
||||
|
||||
// Handle the message
|
||||
ArchiLogger.LogGenericDebug("Handling: " + lastMessage.Message);
|
||||
await HandleMessage(callback.SteamID, callback.SteamID, lastMessage.Message).ConfigureAwait(false);
|
||||
ArchiLogger.LogGenericDebug("Done handling: " + lastMessage.Message);
|
||||
}
|
||||
|
||||
private void OnFriendsList(SteamFriends.FriendsListCallback callback) {
|
||||
|
||||
Reference in New Issue
Block a user