forked from Nexus/nexus
fixup PMPs in encrypted rooms
This commit is contained in:
parent
4800123044
commit
225497030e
1 changed files with 8 additions and 7 deletions
|
|
@ -65,14 +65,15 @@ class const Event({
|
|||
}
|
||||
}
|
||||
|
||||
factory Event.fromJson(Map<String, dynamic> json) =>
|
||||
_$EventFromJson(json).copyWith(
|
||||
factory Event.fromJson(Map<String, dynamic> json) => _$EventFromJson(json)
|
||||
.copyWith(
|
||||
replyTo: replyToFromJson(getContentFromJson(json)),
|
||||
pmp: json["content"]?["com.beeper.per_message_profile"] == null
|
||||
? null
|
||||
: .fromJsonWithCatch(
|
||||
json["content"]?["com.beeper.per_message_profile"],
|
||||
),
|
||||
pmp: switch (getContentFromJson(
|
||||
json,
|
||||
)["com.beeper.per_message_profile"]) {
|
||||
null => null,
|
||||
final pmp => .fromJsonWithCatch(pmp),
|
||||
},
|
||||
content: .fromEventJson(
|
||||
getContentFromJson(json),
|
||||
json["decrypted_type"] ?? json["type"],
|
||||
|
|
|
|||
Loading…
Reference in a new issue