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) =>
|
factory Event.fromJson(Map<String, dynamic> json) => _$EventFromJson(json)
|
||||||
_$EventFromJson(json).copyWith(
|
.copyWith(
|
||||||
replyTo: replyToFromJson(getContentFromJson(json)),
|
replyTo: replyToFromJson(getContentFromJson(json)),
|
||||||
pmp: json["content"]?["com.beeper.per_message_profile"] == null
|
pmp: switch (getContentFromJson(
|
||||||
? null
|
json,
|
||||||
: .fromJsonWithCatch(
|
)["com.beeper.per_message_profile"]) {
|
||||||
json["content"]?["com.beeper.per_message_profile"],
|
null => null,
|
||||||
),
|
final pmp => .fromJsonWithCatch(pmp),
|
||||||
|
},
|
||||||
content: .fromEventJson(
|
content: .fromEventJson(
|
||||||
getContentFromJson(json),
|
getContentFromJson(json),
|
||||||
json["decrypted_type"] ?? json["type"],
|
json["decrypted_type"] ?? json["type"],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue