Support for pinned messages (#49)

The first draft to support pinned messages. Fixes #39.

Co-authored-by: Henry-Hiles <henry@henryhiles.com>
Reviewed-on: Nexus/nexus#49
This commit is contained in:
istalri 2026-07-14 19:29:47 -04:00 committed by Henry Hiles
commit 818e582ddd
15 changed files with 570 additions and 279 deletions

View file

@ -3,7 +3,7 @@ import "package:nexus/models/content/content.dart";
part "reaction.freezed.dart";
part "reaction.g.dart";
@freezed
@Freezed(toJson: false)
abstract class ReactionContent extends Content with _$ReactionContent {
ReactionContent._();
static String? keyJsonFromJson(Map<dynamic, dynamic> json, String key) =>
@ -13,6 +13,11 @@ abstract class ReactionContent extends Content with _$ReactionContent {
@JsonKey(readValue: ReactionContent.keyJsonFromJson) String? key,
}) = _ReactionContent;
@override
Map<String, dynamic> toJson() => {
"m.relates_to": {"key": key},
};
factory ReactionContent.fromJson(Map<String, Object?> json) =>
_$ReactionContentFromJson(json);
}