From 0738ebc717b917643b50f509590fb09a59ea846b Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Tue, 3 Dec 2024 09:53:43 +1300 Subject: [PATCH] Revert "Remove njump.me from the 'open with' menu (it is still used for 'copy web link'), it can be advertised as a handler instead" This reverts commit a39f2066edbdce8ba6915fe6f07c2d8f36094ce3. --- gossip-bin/src/ui/feed/note/mod.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gossip-bin/src/ui/feed/note/mod.rs b/gossip-bin/src/ui/feed/note/mod.rs index 1b810dfa..60a6af40 100644 --- a/gossip-bin/src/ui/feed/note/mod.rs +++ b/gossip-bin/src/ui/feed/note/mod.rs @@ -1476,6 +1476,24 @@ fn note_actions( if !note.event.kind.is_direct_message_related() { let mut my_items: Vec = Vec::new(); + // njump.me + my_items.push(MoreMenuItem::Button(MoreMenuButton::new( + "njump.me", + Box::new(|ui, _| { + let nevent = NEvent { + id: note.event.id, + relays: relays.clone(), + author: None, + kind: None, + }; + let url = format!("https://njump.me/{}", nevent.as_bech32_string()); + ui.ctx().open_url(egui::OpenUrl { + url: url.clone(), + new_tab: true, + }); + }), + ))); + if let Some(handlers) = GLOBALS.handlers.get(¬e.event.kind) { for (label, url) in handlers.value().iter() { let url = if note.event.kind.is_parameterized_replaceable() {