Initial
This commit is contained in:
14
MareAPI/MareSynchronosAPI/Data/SignedChatMessage.cs
Normal file
14
MareAPI/MareSynchronosAPI/Data/SignedChatMessage.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace MareSynchronos.API.Data;
|
||||
|
||||
[MessagePackObject(keyAsPropertyName: true)]
|
||||
public record SignedChatMessage(ChatMessage Message, UserData Sender) : ChatMessage(Message)
|
||||
{
|
||||
// Sender and timestamp are set by the server
|
||||
public UserData Sender { get; set; } = Sender;
|
||||
public long Timestamp { get; set; } = 0;
|
||||
// Signature is generated by the server as SHA256(Sender.UID | Timestamp | Destination | Message)
|
||||
// Where Destination is either the receiver's UID, or the group GID
|
||||
public string Signature { get; set; } = string.Empty;
|
||||
}
|
Reference in New Issue
Block a user