nip4e: remove app name in the client tag
This commit is contained in:
@@ -11,7 +11,7 @@ use gpui::{
|
|||||||
};
|
};
|
||||||
use nostr_sdk::prelude::*;
|
use nostr_sdk::prelude::*;
|
||||||
use person::PersonRegistry;
|
use person::PersonRegistry;
|
||||||
use state::{Announcement, NostrRegistry, StateEvent, TIMEOUT, app_name};
|
use state::{Announcement, CLIENT_NAME, NostrRegistry, StateEvent, TIMEOUT};
|
||||||
use theme::ActiveTheme;
|
use theme::ActiveTheme;
|
||||||
use ui::avatar::Avatar;
|
use ui::avatar::Avatar;
|
||||||
use ui::button::Button;
|
use ui::button::Button;
|
||||||
@@ -301,7 +301,7 @@ impl DeviceRegistry {
|
|||||||
// Construct an announcement event
|
// Construct an announcement event
|
||||||
let builder = EventBuilder::new(Kind::Custom(10044), "").tags(vec![
|
let builder = EventBuilder::new(Kind::Custom(10044), "").tags(vec![
|
||||||
Tag::custom(TagKind::custom("n"), vec![n]),
|
Tag::custom(TagKind::custom("n"), vec![n]),
|
||||||
Tag::client(app_name()),
|
Tag::client(CLIENT_NAME),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Sign the event with user's signer
|
// Sign the event with user's signer
|
||||||
@@ -406,7 +406,7 @@ impl DeviceRegistry {
|
|||||||
// Construct an event for device key request
|
// Construct an event for device key request
|
||||||
let builder = EventBuilder::new(Kind::Custom(4454), "").tags(vec![
|
let builder = EventBuilder::new(Kind::Custom(4454), "").tags(vec![
|
||||||
Tag::custom(TagKind::custom("P"), vec![app_pubkey]),
|
Tag::custom(TagKind::custom("P"), vec![app_pubkey]),
|
||||||
Tag::client(app_name()),
|
Tag::client(CLIENT_NAME),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Sign the event with user's signer
|
// Sign the event with user's signer
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use std::sync::OnceLock;
|
|
||||||
|
|
||||||
/// Client name (Application name)
|
/// Client name (Application name)
|
||||||
pub const CLIENT_NAME: &str = "Coop";
|
pub const CLIENT_NAME: &str = "Coop";
|
||||||
|
|
||||||
@@ -51,15 +49,3 @@ pub const BOOTSTRAP_RELAYS: [&str; 3] = [
|
|||||||
"wss://relay.primal.net",
|
"wss://relay.primal.net",
|
||||||
"wss://user.kindpag.es",
|
"wss://user.kindpag.es",
|
||||||
];
|
];
|
||||||
|
|
||||||
static APP_NAME: OnceLock<String> = OnceLock::new();
|
|
||||||
|
|
||||||
/// Get the app name
|
|
||||||
pub fn app_name() -> &'static String {
|
|
||||||
APP_NAME.get_or_init(|| {
|
|
||||||
let devicename = whoami::devicename();
|
|
||||||
let platform = whoami::platform();
|
|
||||||
|
|
||||||
format!("{CLIENT_NAME} on {platform} ({devicename})")
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user