Port admin logging of AAC messages (#5309)

fix: Admin log AAC tablet messages
This commit is contained in:
Madison Rye Progress 2026-02-01 11:34:18 -08:00 committed by GitHub
parent 5163a21f07
commit c1dbdda5c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions

View File

@ -1,7 +1,9 @@
using Content.Shared.Chat;
using Content.Server.Administration.Logs;
using Content.Server.Chat.Systems;
using Content.Server.Speech.Components;
using Content.Shared._DV.AACTablet;
using Content.Shared.Database;
using Content.Shared.IdentityManagement;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
@ -11,6 +13,7 @@ namespace Content.Server._DV.AACTablet;
public sealed class AACTabletSystem : EntitySystem
{
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
@ -49,12 +52,18 @@ public sealed class AACTabletSystem : EntitySystem
EnsureComp<VoiceOverrideComponent>(ent).NameOverride = speakerName;
// L5 — save the message for logging
var messageToSend = string.Join(" ", _localisedPhrases);
_chat.TrySendInGameICMessage(ent,
string.Join(" ", _localisedPhrases),
messageToSend,
InGameICChatType.Speak,
hideChat: false,
nameOverride: speakerName);
// L5 — log AAC chat message
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"AAC tablet message from {ToPrettyString(message.Actor):user}: {messageToSend}");
var curTime = _timing.CurTime;
ent.Comp.NextPhrase = curTime + ent.Comp.Cooldown;
}