forked from Nexus/nexus
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:
parent
71a4274ff2
commit
818e582ddd
15 changed files with 570 additions and 279 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue