Summary Update.

This commit is contained in:
2026-06-06 23:38:50 -04:00
parent dd75ca4b06
commit 2916d17868
30 changed files with 1231 additions and 21 deletions

View File

@@ -2,14 +2,36 @@ using SurrealDb.Net.Models;
namespace RelayServer.Models;
/// <summary>
/// Surreal record for the `channel_messages` table. One row per message.
///
/// Encryption: CipherText/Nonce/Tag use the channel AES key (ChannelDbKey), NOT any user's
/// RSA keypair. This means the server can decrypt for history queries; the per-recipient
/// RSA wrapping happens at delivery time in DeliverToServerMembers.
/// </summary>
public class ChannelMessages : Record
{
/// <summary>"channels:xyz" — which channel this belongs to.</summary>
public required string ChannelId { get; set; }
/// <summary>"users:keeper317" — who wrote it. Lowercased to match CoreClientService's id format.</summary>
public required string SenderUserId { get; set; }
/// <summary>Base64 AES-GCM ciphertext of the JSON-serialised ChatMessageContent.</summary>
public required string CipherText { get; set; }
/// <summary>Base64 AES-GCM 96-bit nonce. Different every message.</summary>
public required string Nonce { get; set; }
/// <summary>Base64 AES-GCM 128-bit authentication tag.</summary>
public required string Tag { get; set; }
/// <summary>UTC timestamp of original send. Drives history ordering.</summary>
public required DateTime CreatedAt { get; set; }
/// <summary>UTC timestamp of last edit. Null = never edited. Drives the (edited) bubble footer.</summary>
public DateTime? EditedAt { get; set; }
/// <summary>Soft-delete flag. Tombstones in history responses; bubbles show "deleted" placeholder.</summary>
public bool IsDeleted { get; set; }
}