From ce6bd4d4e3fd7b394eae11c49f1647bd4c78045a Mon Sep 17 00:00:00 2001 From: Terry Yiu <963907+tyiu@users.noreply.github.com> Date: Sun, 25 Jun 2023 07:31:48 -0400 Subject: [PATCH] Fix local notification content rendering of repost and reaction events Changelog-Fixed: Fix local notification content rendering of repost and reaction events --- damus/Models/HomeModel.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/damus/Models/HomeModel.swift b/damus/Models/HomeModel.swift index de729444..83de5cb3 100644 --- a/damus/Models/HomeModel.swift +++ b/damus/Models/HomeModel.swift @@ -1164,13 +1164,15 @@ func process_local_notification(damus_state: DamusState, event ev: NostrEvent) { create_local_notification(profiles: damus_state.profiles, notify: notify ) } } else if type == .boost && damus_state.settings.repost_notification, let inner_ev = ev.get_inner_event(cache: damus_state.events) { - let notify = LocalNotification(type: .repost, event: ev, target: inner_ev, content: inner_ev.content) + let content = NSAttributedString(render_note_content(ev: inner_ev, profiles: damus_state.profiles, privkey: damus_state.keypair.privkey).content.attributed).string + let notify = LocalNotification(type: .repost, event: ev, target: inner_ev, content: content) create_local_notification(profiles: damus_state.profiles, notify: notify) } else if type == .like && damus_state.settings.like_notification, let evid = ev.referenced_ids.last?.ref_id, let liked_event = damus_state.events.lookup(evid) { - let notify = LocalNotification(type: .like, event: ev, target: liked_event, content: liked_event.content) + let content = NSAttributedString(render_note_content(ev: liked_event, profiles: damus_state.profiles, privkey: damus_state.keypair.privkey).content.attributed).string + let notify = LocalNotification(type: .like, event: ev, target: liked_event, content: content) create_local_notification(profiles: damus_state.profiles, notify: notify) }