I knew I forgot about something

This commit is contained in:
Archi
2022-12-30 17:22:21 +01:00
parent bcebccdb5d
commit 9144684df9

View File

@@ -147,14 +147,14 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable {
internal void OnNewItemsNotification() => ShouldSendAnnouncementEarlier = true;
internal async Task OnPersonaState(string? nickname = null, string? avatarHash = null) {
if (WebBrowser == null) {
throw new InvalidOperationException(nameof(WebBrowser));
}
if (!Bot.BotConfig.RemoteCommunication.HasFlag(BotConfig.ERemoteCommunication.PublicListing) || !Bot.BotConfig.TradingPreferences.HasFlag(BotConfig.ETradingPreferences.SteamTradeMatcher)) {
return;
}
if (WebBrowser == null) {
throw new InvalidOperationException(nameof(WebBrowser));
}
if ((DateTime.UtcNow < LastAnnouncement.AddMinutes(ShouldSendAnnouncementEarlier ? MinAnnouncementTTL : MaxAnnouncementTTL)) && ShouldSendHeartBeats) {
return;
}