Add profile zaps

Refactor profile zaps to reuse same BOLT11 Lightning invoice logic as
note zaps, which fixes profile zaps from Cash App and Muun wallets

Changelog-Added: Add profile zaps
Changelog-Fixed: Fix profile zapping for Muun and Strike wallets
Closes: #1236
Fixes: #1067
This commit is contained in:
2023-06-01 20:51:50 -04:00
committed by William Casarin
parent b3b335f917
commit 952d6746d5
9 changed files with 130 additions and 36 deletions

View File

@@ -456,6 +456,11 @@ struct ContentView: View {
let damus_state else {
return
}
if local.type == .profile_zap {
open_profile(id: local.event_id)
return
}
guard let target = damus_state.events.lookup(local.event_id) else {
return
@@ -471,6 +476,9 @@ struct ContentView: View {
case .mention: fallthrough
case .repost:
open_event(ev: target)
case .profile_zap:
// Handled separately above.
break
}
}
.onReceive(handle_notify(.onlyzaps_mode)) { notif in