Final API11 updates and new channel switcher

This commit is contained in:
Infi
2024-11-16 21:06:35 +01:00
parent c5873b95cf
commit bf27d3e853
15 changed files with 193 additions and 190 deletions
+2 -2
View File
@@ -17,13 +17,13 @@ public class Processing
internal (MessageTemplate[] ChannelName, bool Locked) ReadChannelName(Chunk[] channelName)
{
var locked = Plugin.ChatLogWindow.CurrentTab is not { Channel: null };
var locked = Plugin.CurrentTab is not { Channel: null };
return (channelName.Select(ProcessChunk).ToArray(), locked);
}
internal async Task<MessageResponse[]> ReadMessageList()
{
var tabMessages = await Plugin.ChatLogWindow.CurrentTab!.Messages.GetCopy();
var tabMessages = await Plugin.CurrentTab!.Messages.GetCopy();
return tabMessages.TakeLast(Plugin.Config.WebinterfaceMaxLinesToSend).Select(ReadMessageContent).ToArray();
}
+1 -7
View File
@@ -154,12 +154,6 @@ public class RouteController
#region PostAuthRoutes
private async Task ChatBoxRoute(HttpContextBase ctx)
{
if (Plugin.ChatLogWindow.CurrentTab == null)
{
await ctx.Response.Send("No valid chat tab!");
return;
}
await ctx.Response.Send(ChatBoxTemplate);
}
@@ -183,7 +177,7 @@ public class RouteController
await Plugin.Framework.RunOnFrameworkThread(() =>
{
Plugin.ChatLogWindow.Chat = content.Message;
Plugin.ChatLogWindow.SendChatBox(Plugin.ChatLogWindow.CurrentTab);
Plugin.ChatLogWindow.SendChatBox(Plugin.CurrentTab);
});
ctx.Response.StatusCode = 201;
+1
View File
@@ -1,4 +1,5 @@
using ChatTwo.Http.MessageProtocol;
namespace ChatTwo.Http;
public class ServerCore : IAsyncDisposable