💥 New message system and syncing API

This commit is contained in:
2025-09-22 01:47:24 +08:00
parent 5b31357fe9
commit b785d0098b
3 changed files with 280 additions and 166 deletions

View File

@@ -31,6 +31,33 @@ public class Message : ModelBase, IIdentifiedResource
[JsonIgnore] public ChatRoom ChatRoom { get; set; } = null!;
public string ResourceIdentifier => $"message:{Id}";
/// <summary>
/// Creates a shallow clone of this message for sync operations
/// </summary>
/// <returns>A new Message instance with copied properties</returns>
public Message Clone()
{
return new Message
{
Id = Id,
Type = Type,
Content = Content,
Meta = Meta,
MembersMentioned = MembersMentioned,
Nonce = Nonce,
EditedAt = EditedAt,
Attachments = Attachments,
RepliedMessageId = RepliedMessageId,
ForwardedMessageId = ForwardedMessageId,
SenderId = SenderId,
Sender = Sender,
ChatRoomId = ChatRoomId,
ChatRoom = ChatRoom,
CreatedAt = CreatedAt,
UpdatedAt = UpdatedAt
};
}
}
public enum MessageReactionAttitude
@@ -50,4 +77,4 @@ public class MessageReaction : ModelBase
[MaxLength(256)] public string Symbol { get; set; } = null!;
public MessageReactionAttitude Attitude { get; set; }
}
}