Skip to content

Commit 6738f57

Browse files
committed
nostr(nip25): impl From<&Event> for ReactionTarget
Closes nostr:nevent1qvzqqqqx25pzpepndn2jthmelfxn4umylktqp493ph8yy9d2fse76al2ppprgjcsqqsxxm0t4t2x0jkcrxnxfe0ssxfzxmuqvkas7yf4xgxtvhjd2k6sjuqsy6pfj Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent c523265 commit 6738f57

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/nostr/src/nips/nip25.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,15 @@ impl ReactionTarget {
7474
tags
7575
}
7676
}
77+
78+
impl From<&Event> for ReactionTarget {
79+
fn from(event: &Event) -> Self {
80+
Self {
81+
event_id: event.id,
82+
public_key: event.pubkey,
83+
coordinate: event.coordinate().map(|c| c.into_owned()),
84+
kind: Some(event.kind),
85+
relay_hint: None,
86+
}
87+
}
88+
}

0 commit comments

Comments
 (0)