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

Commit

Permalink
Add event id to dm
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Jan 24, 2024
1 parent 4946847 commit 3c4b87a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mutiny-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ use crate::{nostr::NostrManager, utils::sleep};
use ::nostr::key::XOnlyPublicKey;
use ::nostr::nips::nip57;
use ::nostr::prelude::ZapRequestData;
use ::nostr::{Event, JsonUtil, Kind};
use ::nostr::{Event, EventId, JsonUtil, Kind};
use async_lock::RwLock;
use bdk_chain::ConfirmationTime;
use bip39::Mnemonic;
Expand Down Expand Up @@ -430,6 +430,7 @@ pub struct DirectMessage {
pub to: XOnlyPublicKey,
pub message: String,
pub date: u64,
pub event_id: EventId,
}

impl PartialOrd for DirectMessage {
Expand Down Expand Up @@ -1530,6 +1531,7 @@ impl<S: MutinyStorage> MutinyWallet<S> {
to,
message,
date: event.created_at.as_u64(),
event_id: event.id,
};
messages.push(dm);
}
Expand Down
2 changes: 2 additions & 0 deletions mutiny-wasm/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@ pub struct DirectMessage {
pub to: String,
pub message: String,
pub date: u64,
pub event_id: String,
}

impl From<mutiny_core::DirectMessage> for DirectMessage {
Expand All @@ -1123,6 +1124,7 @@ impl From<mutiny_core::DirectMessage> for DirectMessage {
to: value.to.to_bech32().expect("bech32"),
message: value.message,
date: value.date,
event_id: value.event_id.to_hex(),
}
}
}

0 comments on commit 3c4b87a

Please sign in to comment.