forked from Henry-Hiles/nexus
fix images
This commit is contained in:
parent
3e0d8304b6
commit
163facca7e
1 changed files with 9 additions and 10 deletions
|
|
@ -78,16 +78,6 @@ class MessageController extends AsyncNotifier<Message?> {
|
|||
? author?.content["displayname"]
|
||||
: event.authorId.substring(1).split(":")[0],
|
||||
"txnId": config.event.transactionId,
|
||||
"image": content["msgtype"] == "m.image"
|
||||
? Message.image(
|
||||
id: "${config.event.eventId}-image",
|
||||
authorId: event.authorId,
|
||||
source: source,
|
||||
replyToMessageId: replyId,
|
||||
deliveredAt: config.event.timestamp,
|
||||
blurhash: (content["info"] as Map?)?["xyz.amorgan.blurhash"],
|
||||
)
|
||||
: null,
|
||||
};
|
||||
|
||||
if (!ref.mounted) return null;
|
||||
|
|
@ -138,6 +128,15 @@ class MessageController extends AsyncNotifier<Message?> {
|
|||
// authorId: senderId,
|
||||
// ),
|
||||
("m.sticker" || "m.room.message") => switch (content["msgtype"]) {
|
||||
null || "m.image" => Message.image(
|
||||
id: "${config.event.eventId}-image",
|
||||
authorId: event.authorId,
|
||||
source: source,
|
||||
replyToMessageId: replyId,
|
||||
text: asText.text,
|
||||
deliveredAt: config.event.timestamp,
|
||||
blurhash: (content["info"] as Map?)?["xyz.amorgan.blurhash"],
|
||||
),
|
||||
"m.audio" || "m.file" => Message.file(
|
||||
name: content["filename"].toString(),
|
||||
size: content["info"]["size"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue