Files
Relay/RelayServer/Models/Chat/ChannelMessageEdits.cs
2026-06-06 23:38:50 -04:00

26 lines
1002 B
C#

using SurrealDb.Net.Models;
namespace RelayServer.Models;
/// <summary>
/// Surreal record for the `channel_message_edits` table. One row per historical version of
/// an edited message — written by HandleEditMessage BEFORE overwriting the live row.
///
/// Encrypted with the channel AES key (same as ChannelMessages), so HandleGetEditHistory
/// can decrypt + re-encrypt per requester.
/// </summary>
public class ChannelMessageEdits : Record
{
/// <summary>"channel_messages:abc" — which live message this version belonged to.</summary>
public required string MessageId { get; set; }
/// <summary>Base64 AES-GCM ciphertext of the JSON-serialised previous ChatMessageContent.</summary>
public required string CipherText { get; set; }
public required string Nonce { get; set; }
public required string Tag { get; set; }
/// <summary>When this version was the current text (i.e. when it was replaced).</summary>
public required DateTime EditedAt { get; set; }
}