add thread support

Fixes #129
This commit is contained in:
Henry Hiles 2026-11-05 19:14:46 -05:00
commit 7f7bdbf525
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -38,11 +38,18 @@ class const Mentions({
class const Relation({
required final String eventId,
required final RelationType relationType,
final String? threadRoot,
final bool isFallingBack = false,
}) with _$Relation {
Map<String, dynamic> toJson() {
switch (relationType) {
case RelationType.reply:
return {
if (threadRoot != null) ...{
"rel_type": "m.thread",
"event_id": threadRoot,
"is_falling_back": isFallingBack,
},
"m.in_reply_to": {"event_id": eventId},
};