- Implement unread state sync for SSE

This commit is contained in:
Infi
2025-10-01 21:30:41 +02:00
parent ad77299e9e
commit c54efe5420
6 changed files with 64 additions and 14 deletions
+11 -1
View File
@@ -7,10 +7,11 @@ namespace ChatTwo.Http.MessageProtocol;
/// <summary>
/// Contains a valid tab with its assigned index
/// </summary>
public struct ChatTab(string name, int index)
public struct ChatTab(string name, int index, uint unreadCount)
{
[JsonProperty("name")] public string Name = name;
[JsonProperty("index")] public int Index = index;
[JsonProperty("unreadCount")] public uint UnreadCount = unreadCount;
}
/// <summary>
@@ -21,6 +22,15 @@ public struct ChatTabList(ChatTab[] tabs)
[JsonProperty("tabs")] public ChatTab[] Tabs = tabs;
}
/// <summary>
/// Contains a valid tab index and the current unread state as a number unread of messages
/// </summary>
public struct ChatTabUnreadState(int index, uint unreadCount)
{
[JsonProperty("index")] public int Index = index;
[JsonProperty("unreadCount")] public uint UnreadCount = unreadCount;
}
/// <summary>
/// Contains the current channel name
/// </summary>