Move message processing to javascript, future proofing it for other frameworks
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
namespace ChatTwo.Http.MessageProtocol;
|
||||
|
||||
#region Outgoing SSE
|
||||
public struct SwitchChannel(string name)
|
||||
public struct SwitchChannel(MessageTemplate[] channelName)
|
||||
{
|
||||
[JsonProperty("channel")] public string Name = name;
|
||||
[JsonProperty("channelName")] public MessageTemplate[] ChannelName = channelName;
|
||||
}
|
||||
|
||||
public struct ChannelList(Dictionary<string, uint> channels)
|
||||
@@ -21,7 +21,18 @@ public struct Messages(MessageResponse[] set)
|
||||
public struct MessageResponse()
|
||||
{
|
||||
[JsonProperty("timestamp")] public string Timestamp = "";
|
||||
[JsonProperty("messageHTML")] public string Message = "";
|
||||
[JsonProperty("templates")] public MessageTemplate[] Templates;
|
||||
}
|
||||
|
||||
public struct MessageTemplate()
|
||||
{
|
||||
[JsonProperty("payload")] public required string Payload;
|
||||
|
||||
[JsonProperty("content")] public string Content = "";
|
||||
[JsonProperty("id")] public uint Id;
|
||||
[JsonProperty("color")] public uint Color;
|
||||
|
||||
public static MessageTemplate Empty => new() {Payload = "empty"};
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user