Final API11 updates and new channel switcher
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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,4 +1,5 @@
|
||||
using ChatTwo.Http.MessageProtocol;
|
||||
|
||||
namespace ChatTwo.Http;
|
||||
|
||||
public class ServerCore : IAsyncDisposable
|
||||
|
||||
Reference in New Issue
Block a user