Remove webinterface dependencies and build artifacts

Drops Watson.Lite (the HTTP server) and Newtonsoft.Json (only used by
the webinterface JSON wire format) from the package references and
removes websiteBuild.zip plus the UnzipBuild target that extracted it
into the build output. The commented-out NodeJS compile blocks for
the Svelte frontend go with them.

DbViewer used to ship a CreateTempJsonFile button that exported the
database in the webinterface message-protocol shape (MessageResponse,
MessageTemplate, WebPayloadType). With no client able to consume that
shape any more the button, the method and the two helper methods are
removed. The Privacy tab's MessageExporter already covers Markdown,
JSON and CSV exports with channel and date filters and is the
supported way to get history out of the plugin.

Build verified clean (Release, 0 warnings, 0 errors). The lockfile
shrinks accordingly.
This commit is contained in:
2026-05-02 02:23:56 +02:00
parent c2801c4113
commit c09aa26ffc
4 changed files with 6 additions and 224 deletions
-23
View File
@@ -21,7 +21,6 @@
<PackageReference Include="morelinq" Version="4.4.0" />
<PackageReference Include="Pidgin" Version="3.3.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageReference Include="Watson.Lite" Version="6.3.9" />
</ItemGroup>
<ItemGroup>
@@ -73,26 +72,4 @@
</None>
</ItemGroup>
<!--This doesn't work until Plogon is updated to include NodeJS-->
<!-- <Target Name="NodeJS Compile" BeforeTargets="BeforeCompile">-->
<!-- <Exec Command="npm install" WorkingDirectory="Http\Frontend"/>-->
<!-- <Exec Command="npm run build" WorkingDirectory="Http\Frontend"/>-->
<!-- </Target>-->
<!-- -->
<!-- <Target Name="CopyFiles" AfterTargets="Build">-->
<!-- <ItemGroup>-->
<!-- <Files Include="$(MSBuildThisFileDirectory)\Http\Frontend\build\**" />-->
<!-- </ItemGroup>-->
<!-- -->
<!-- <Copy SourceFiles="@(Files)" DestinationFolder="$(TargetDir)\Frontend\%(RecursiveDir)" />-->
<!-- </Target>-->
<!-- <Target Name="NodeJS Compile" BeforeTargets="BeforeCompile" Condition="'$(Configuration)' == 'Debug'">-->
<!-- <Exec Command="npm install" WorkingDirectory="Http\Frontend"/>-->
<!-- <Exec Command="npm run build" WorkingDirectory="Http\Frontend"/>-->
<!-- </Target>-->
<Target Name="UnzipBuild" AfterTargets="Build">
<Unzip SourceFiles="websiteBuild.zip" DestinationFolder="$(TargetDir)\Frontend"/>
</Target>
</Project>
+6 -155
View File
@@ -17,7 +17,6 @@ using Dalamud.Interface.ImGuiNotification;
using Lumina.Data.Files;
using Lumina.Text.ReadOnly;
using MoreLinq;
using Newtonsoft.Json;
namespace ChatTwo.Ui;
@@ -166,28 +165,12 @@ public class DbViewer : Window
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
ImGui.SetTooltip(Language.Export_Txt_Tooltip);
ImGui.SameLine(0, spacing);
using (ImRaii.Disabled(InputPath.Length == 0 || IsExporting))
{
if (ImGuiUtil.IconButton(FontAwesomeIcon.FileExport))
{
Notification = Plugin.Notification.AddNotification(
new Notification
{
Title = "Chat2 Json Export",
Content = Language.ChatExport_Initial,
Type = NotificationType.Info,
Minimized = false,
UserDismissable = false,
InitialDuration = TimeSpan.FromSeconds(10000),
Progress = 0.0f,
});
CreateTempJsonFile();
}
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
ImGui.SetTooltip(Language.Export_Json_Tooltip);
// Hellion Chat: the JSON export button used to dump the database in
// the upstream webinterface's wire format. With the webinterface
// removed there is no consumer for that format any more, so the
// button is dropped. The Privacy tab's MessageExporter covers the
// same ground (Markdown / JSON / CSV) with channel and date filters
// and is the supported way to get history out of the plugin.
var width = 350 * ImGuiHelpers.GlobalScale;
var loadingIndicator = IsProcessing && ProcessingStart < Environment.TickCount64;
@@ -461,136 +444,4 @@ public class DbViewer : Window
});
}
private void CreateTempJsonFile()
{
IsExporting = true;
Task.Run(async () =>
{
try
{
var channels = SelectedChannels.Select(pair => (byte)pair.Key).ToArray();
var rangeMessageEnumerator = Plugin.MessageManager.Store.GetDateRange(AfterDate, BeforeDate, channels);
var messageHistory = rangeMessageEnumerator.ToArray();
await rangeMessageEnumerator.DisposeAsync();
var filteredHistory = Filter(messageHistory);
await using var stream = new StreamWriter(Path.Join(InputPath, $"Chat2_{DateTime.Now:yyyy_dd_M__HH_mm_ss}.json"));
var batch = 0;
var messageContainer = new Messages();
List<MessageResponse> templates = [];
foreach (var messages in filteredHistory.Batch(5000))
{
foreach (var message in messages)
{
templates.Add(ReadMessageContent(message));
batch++;
}
Notification.Progress = (float)batch / filteredHistory.Count;
Notification.Content = $"Exported {batch} of {filteredHistory.Count} messages";
await Task.Delay(100);
}
messageContainer.Set = templates.ToArray();
await stream.WriteAsync(JsonConvert.SerializeObject(messageContainer));
templates.Clear();
await using (var fileStream = File.Open(Path.Join(InputPath, "gfdata.gfd"), FileMode.OpenOrCreate))
{
await using var byteWriter = new BinaryWriter(fileStream);
byteWriter.Write(Plugin.DataManager.GetFile("common/font/gfdata.gfd")!.Data);
}
await using (var fileStream = File.Open(Path.Join(InputPath, "fonticon_ps5.tex"), FileMode.OpenOrCreate))
{
await using var byteWriter = new BinaryWriter(fileStream);
byteWriter.Write(Plugin.DataManager.GetFile<TexFile>("common/font/fonticon_ps5.tex")!.Data);
}
await using (var fileStream = File.Open(Path.Join(InputPath, "FFXIV_Lodestone_SSF.ttf"), FileMode.OpenOrCreate))
{
await using var byteWriter = new BinaryWriter(fileStream);
byteWriter.Write(Plugin.FontManager.GameSymFont);
}
Notification.Progress = 1.0f;
Notification.Content = "Done!!!";
Notification.Type = NotificationType.Success;
}
catch (Exception ex)
{
Plugin.Log.Error(ex, "Failed creating txt backup");
Notification.Content = "Error ...";
Notification.Type = NotificationType.Error;
}
finally
{
IsExporting = false;
Notification.UserDismissable = true;
}
});
}
private MessageResponse ReadMessageContent(Message message)
{
var response = new MessageResponse
{
Id = message.Id,
Timestamp = message.Date.ToLocalTime().ToString("t", !Plugin.Config.Use24HourClock ? null : CultureInfo.CreateSpecificCulture("es-ES"))
};
var sender = message.Sender.Select(ProcessChunk);
var content = message.Content.Select(ProcessChunk);
response.Templates = sender.Concat(content).ToArray();
return response;
}
private MessageTemplate ProcessChunk(Chunk chunk)
{
if (chunk is IconChunk { } icon)
{
var iconId = (uint)icon.Icon;
return IconUtil.GfdFileView.TryGetEntry(iconId, out _) ? new MessageTemplate {PayloadType = WebPayloadType.Icon, IconId = iconId}: MessageTemplate.Empty;
}
if (chunk is TextChunk { } text)
{
if (chunk.Link is EmotePayload emotePayload && Plugin.Config.ShowEmotes)
{
var image = EmoteCache.GetEmote(emotePayload.Code);
if (image is { Failed: false })
return new MessageTemplate { PayloadType = WebPayloadType.CustomEmote, Color = 0, Content = emotePayload.Code };
}
var color = text.Foreground;
if (color == null && text.FallbackColour != null)
{
var type = text.FallbackColour.Value;
color = Plugin.Config.ChatColours.TryGetValue(type, out var col) ? col : type.DefaultColor();
}
color ??= 0;
var userContent = text.Content;
if (Plugin.ChatLogWindow.ScreenshotMode)
{
if (chunk.Link is PlayerPayload playerPayload)
userContent = Plugin.ChatLogWindow.HidePlayerInString(userContent, playerPayload.PlayerName, playerPayload.World.RowId);
else if (Plugin.PlayerState.IsLoaded)
userContent = Plugin.ChatLogWindow.HidePlayerInString(userContent, Plugin.PlayerState.CharacterName, Plugin.PlayerState.HomeWorld.RowId);
}
var isNotUrl = text.Link is not UriPayload;
return new MessageTemplate { PayloadType = isNotUrl ? WebPayloadType.RawText : WebPayloadType.CustomUri, Color = color.Value, Content = userContent };
}
return MessageTemplate.Empty;
}
}
-46
View File
@@ -54,26 +54,6 @@
"resolved": "3.1.12",
"contentHash": "iAg6zifihXEFS/t7fiHhZBGAdCp3FavsF4i2ZIDp0JfeYeDVzvmlbY1CNhhIKimaIzrzSi5M/NBFcWvZT2rB/A=="
},
"Watson.Lite": {
"type": "Direct",
"requested": "[6.3.9, )",
"resolved": "6.3.9",
"contentHash": "sDigTY8D8V7W38lfzJGiigf7xZEfp3Kw7XE7VJyeNO9mxOkv+w8HcmCsmORMDhsipDqGU0gMEsPOqORmZzRaWg==",
"dependencies": {
"CavemanTcp": "2.0.9",
"Watson.Core": "6.3.9"
}
},
"CavemanTcp": {
"type": "Transitive",
"resolved": "2.0.9",
"contentHash": "KgIwYhPhGkBTm+wwVAmWonkKPw4xYVnutzzlIeqOLcX1fti+8d+MEGTvbern1smf3S/UpjFjihkf6XRziTddzQ=="
},
"IpMatcher": {
"type": "Transitive",
"resolved": "1.0.5",
"contentHash": "WXNlWERj+0GN699AnMNsuJ7PfUAbU4xhOHP3nrNXLHqbOaBxybu25luSYywX1133NSlitA4YkSNmJuyPvea4sw=="
},
"MessagePack.Annotations": {
"type": "Transitive",
"resolved": "3.1.4",
@@ -97,11 +77,6 @@
"resolved": "17.11.4",
"contentHash": "mudqUHhNpeqIdJoUx2YDWZO/I9uEDYVowan89R6wsomfnUJQk6HteoQTlNjZDixhT2B4IXMkMtgZtoceIjLRmA=="
},
"RegexMatcher": {
"type": "Transitive",
"resolved": "1.0.9",
"contentHash": "RkQGXIrqHjD5h1mqefhgCbkaSdRYNRG5rrbzyw5zeLWiS0K1wq9xR3cNhQdzYR2MsKZ3GN523yRUsEQIMPxh3Q=="
},
"SQLitePCLRaw.bundle_e_sqlite3": {
"type": "Transitive",
"resolved": "2.1.10",
@@ -128,27 +103,6 @@
"dependencies": {
"SQLitePCLRaw.core": "2.1.10"
}
},
"Timestamps": {
"type": "Transitive",
"resolved": "1.0.11",
"contentHash": "SnWhXm3FkEStQGgUTfWMh9mKItNW032o/v8eAtFrOGqG0/ejvPPA1LdLZx0N/qqoY0TH3x11+dO00jeVcM8xNQ=="
},
"UrlMatcher": {
"type": "Transitive",
"resolved": "3.0.1",
"contentHash": "hHBZVzFSfikrx4XsRsnCIwmGLgbNKtntnlqf4z+ygcNA6Y/L/J0x5GiZZWfXdTfpxhy5v7mlt2zrZs/L9SvbOA=="
},
"Watson.Core": {
"type": "Transitive",
"resolved": "6.3.9",
"contentHash": "hGoadE4SLbko8yxhx5+nxGV8lEVgEquNli87lN6/eOTQEJNpK/Cs+OF0etTgFKZ4p0u5ivetoDxl82Lg6oHZEg==",
"dependencies": {
"IpMatcher": "1.0.5",
"RegexMatcher": "1.0.9",
"Timestamps": "1.0.11",
"UrlMatcher": "3.0.1"
}
}
}
}
Binary file not shown.