Compare commits

..

1 Commits

Author SHA1 Message Date
tyiu ce6bd4d4e3 Fix local notification content rendering of repost and reaction events
Changelog-Fixed: Fix local notification content rendering of repost and reaction events
2023-06-25 07:35:26 -04:00
2 changed files with 51 additions and 57 deletions
+4 -2
View File
@@ -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)
}
-8
View File
@@ -466,7 +466,6 @@ struct ProfileView: View {
}
var body: some View {
ZStack {
ScrollView(.vertical) {
VStack(spacing: 0) {
bannerSection
@@ -522,13 +521,6 @@ struct ProfileView: View {
.fullScreenCover(isPresented: $show_qr_code) {
QRCodeView(damus_state: damus_state, pubkey: profile.pubkey)
}
if profile.pubkey == damus_state.pubkey && damus_state.is_privkey_user {
PostButtonContainer(is_left_handed: damus_state.settings.left_handed) {
notify(.compose, PostAction.posting)
}
}
}
}
}