Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
Merge pull request #1106 from MutinyWallet/zap-fix
Browse files Browse the repository at this point in the history
Fix for zap stuff
  • Loading branch information
AnthonyRonning authored Apr 4, 2024
2 parents f3ec0cb + 16f8b29 commit 88dd5cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions mutiny-core/src/hermes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use lightning::util::logger::Logger;
use lightning::{log_error, log_info, log_warn};
use lightning_invoice::Bolt11Invoice;
use nostr::prelude::decrypt_received_private_zap_message;
use nostr::{nips::nip04::decrypt, Event, Keys, Tag};
use nostr::{nips::nip04::decrypt, Event, JsonUtil, Keys, Tag};
use nostr::{Filter, Kind, Timestamp};
use nostr_sdk::{Client, RelayPoolNotification};
use reqwest::Method;
Expand Down Expand Up @@ -413,7 +413,7 @@ struct EcashNotification {
pub federation_id: FederationId,
/// The zap request that came along with this payment,
/// useful for tagging the payment to a contact
pub zap_request: Option<Event>,
pub zap_request: Option<String>,
/// The bolt11 invoice for the payment
pub bolt11: Bolt11Invoice,
/// The preimage for the bolt11 invoice
Expand Down Expand Up @@ -454,6 +454,7 @@ async fn handle_ecash_notification<S: MutinyStorage>(
let (privacy_level, msg, npub) = match notification.zap_request {
None => (PrivacyLevel::NotAvailable, None, None),
Some(zap_req) => {
let zap_req = Event::from_json(zap_req)?;
// handle private/anon zaps
let anon = zap_req.iter_tags().find_map(|tag| {
if let Tag::Anon { msg } = tag {
Expand Down

0 comments on commit 88dd5cf

Please sign in to comment.