Watch
1
0
Fork
You've already forked nexus
0
forked from Nexus/nexus

include avatars on notifs

This commit is contained in:
Henry Hiles 2026-08-26 00:46:57 -04:00
commit 74207e405b
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
4 changed files with 23 additions and 3 deletions

View file

@ -53,11 +53,19 @@ class UnifiedPushController extends AsyncNotifier<bool> {
RoomsController.provider.select((rooms) => rooms[event.roomId]),
);
final avatar = room?.metadata?.avatar;
final icon = avatar == null
? null
: await ref
.read(ClientController.provider.notifier)
.downloadMedia(.new(mxc: avatar, isAvatar: true));
await ref
.read(NotificationsController.provider.notifier)
.send(
id: event.eventId.hashCode & 0x7fffffff,
title: room?.metadata?.name ?? "New Message",
icon: icon,
body: switch (event.content) {
MessageContent(:final body) => body,
// TODO: Handle more types