Chat: read the host's own wording of each line

DECAL handed the original each line as the chat window shows it, tell links
included; the host now reports the same wording (DisplayText). Kill, rare,
combat and !report parsing and the chat frame read that, with tags stripped
for the frame exactly as before; the plugin's own formatter remains only for
a line the host did not word.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-09-25 12:45:49 +02:00
parent 5a94e1cf0b
commit 0af4efb6b6
3 changed files with 28 additions and 1 deletions

View file

@ -400,11 +400,13 @@ public sealed class RecordingChat : IPluginChat
string channelName = "",
int logTextType = 0,
int combatKind = 0,
uint senderObjectId = 0u)
uint senderObjectId = 0u,
string displayText = "")
{
var message = new PluginChatMessage(
_nextSequence++, senderObjectId, kind, sender, text, channelName)
{
DisplayText = displayText,
LogTextType = logTextType,
CombatKind = combatKind,
Received = DateTimeOffset.UtcNow,

View file

@ -181,6 +181,25 @@ public sealed class StreamGoldenTests
Assert.Single(harness.Frames));
}
[Fact]
public void Chat_uses_the_hosts_wording_with_tell_links_stripped_like_the_original()
{
// The original read DECAL's chat text, which carries tell links; its
// chat stream stripped tags (ChatEventRouter.cs:83-91), and its
// !report check looked for allegiance lines ending in !report".
using var harness = LoggedIn();
harness.Host.Automation.Chat.Deliver(
"!report", kind: 2, sender: "Horan", channelName: "Allegiance", logTextType: 18,
displayText: "[Allegiance] <Tell:IIDString:1342177282:Horan>Horan<\\Tell> says, \"!report\"");
Assert.Equal(
"{\"type\":\"chat\",\"timestamp\":\"" + Stamp + "\",\"character_name\":\"Mossy\","
+ "\"text\":\"[Allegiance] Horan says, \\\"!report\\\"\",\"color\":18}",
Assert.Single(harness.Frames));
Assert.StartsWith("/a Total Kills: 0, Kills per Hour: ", Assert.Single(harness.Host.Automation.Chat.Submitted));
}
[Fact]
public void Spawn_frame_has_string_coordinates()
{