Add persistent Inbox and RFC 8291/8292 Web Push notification system
This commit is contained in:
parent
4714d25724
commit
7cc9ba7f4d
27 changed files with 3573 additions and 17 deletions
|
|
@ -30,6 +30,11 @@ public static class MessageTypes
|
|||
public const string Error = "ERROR";
|
||||
public const string ExecuteCommand = "EXECUTE_COMMAND";
|
||||
public const string CommandResult = "COMMAND_RESULT";
|
||||
public const string InboxSync = "INBOX_SYNC";
|
||||
public const string InboxNewItem = "INBOX_NEW_ITEM";
|
||||
public const string InboxAction = "INBOX_ACTION";
|
||||
public const string UpdateInboxPreferences = "UPDATE_INBOX_PREFERENCES";
|
||||
public const string ToggleFollowChannel = "TOGGLE_FOLLOW_CHANNEL";
|
||||
public const string Ping = "PING";
|
||||
public const string Pong = "PONG";
|
||||
}
|
||||
|
|
@ -232,3 +237,38 @@ public class CommandResultPacket
|
|||
public string Output { get; set; } = string.Empty;
|
||||
public string ChannelId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class InboxSyncPacket
|
||||
{
|
||||
public List<InboxItem> Items { get; set; } = new();
|
||||
public int UnreadCount { get; set; }
|
||||
public InboxPreferences Preferences { get; set; } = new();
|
||||
}
|
||||
|
||||
public class InboxNewItemPacket
|
||||
{
|
||||
public InboxItem Item { get; set; } = new();
|
||||
public int UnreadCount { get; set; }
|
||||
}
|
||||
|
||||
public class InboxActionPacket
|
||||
{
|
||||
public string Action { get; set; } = string.Empty; // "mark_read", "mark_all_read", "dismiss", "clear_read", "clear_all"
|
||||
public string? ItemId { get; set; }
|
||||
public string? ChannelId { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateInboxPreferencesPacket
|
||||
{
|
||||
public bool? MentionsEnabled { get; set; }
|
||||
public bool? AnnouncementsEnabled { get; set; }
|
||||
public bool? DirectMessagesEnabled { get; set; }
|
||||
public bool? FollowedChannelsEnabled { get; set; }
|
||||
public bool? PushNotificationsEnabled { get; set; }
|
||||
}
|
||||
|
||||
public class ToggleFollowChannelPacket
|
||||
{
|
||||
public string ChannelId { get; set; } = string.Empty;
|
||||
public bool? Follow { get; set; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue