Files
HellionChat/HellionChat/_Helpers/FailedTellMatcher.cs
T

28 lines
1.0 KiB
C#

using System.Collections.Generic;
namespace HellionChat._Helpers;
// Pure decision helper for failed-tell detection. The processed message
// stream carries no LogMessage row id, so detection happens at the
// RaptureLogModule level (see FailedTellNotifier). This POCO stays free of
// Dalamud types so the "known id AND enabled" rule is Build-Suite testable.
// TEST-MIRROR: ../../../Hellion Build test/Ui/FailedTellMatcherTests.cs
public static class FailedTellMatcher
{
// Log-message ids the game raises for a tell that could not be delivered,
// pinned from in-game discovery. 50 covers an unreachable recipient
// (offline, non-existent, or on another world); 3832 is a recipient
// inside an instance.
public static readonly IReadOnlySet<uint> FailedTellLogMessageIds = new HashSet<uint>
{
50u,
3832u,
};
public static bool ShouldNotify(
uint logMessageId,
bool notifyEnabled,
IReadOnlySet<uint> failedTellIds
) => notifyEnabled && failedTellIds.Contains(logMessageId);
}