fix(auto-tell-tabs): fall back to SeString payloads for tell sender extraction

This commit is contained in:
2026-05-02 13:45:00 +02:00
parent a9d4e9bd69
commit f8b0804321
2 changed files with 39 additions and 6 deletions
+20
View File
@@ -415,6 +415,26 @@ internal static class ChunkUtil
return null;
}
// Fallback for tells where the PlayerPayload lives in the raw SeString
// payload list rather than on a chunk's Link slot. Same semantics as
// the chunk-walking variant above: returns the first PlayerPayload or
// null if the SeString has none.
internal static PlayerPayload? TryGetPlayerPayload(SeString? seString)
{
if (seString == null)
{
return null;
}
foreach (var payload in seString.Payloads)
{
if (payload is PlayerPayload pp)
{
return pp;
}
}
return null;
}
// True when the message's sender (or, as a fallback, content) carries a
// PlayerPayload that matches the given identity. Used by both the
// Tab.Matches sender filter and the MessageStore tell-history scan.