diff --git a/config.toml b/config.toml index 6a78aba..cec4849 100644 --- a/config.toml +++ b/config.toml @@ -160,7 +160,7 @@ reject_future_seconds = 1800 #] # Enable NIP-42 authentication #nip42_auth = false -# Send DMs events (kind 4) only to their authenticated recipients +# Send DMs (kind 4 and 44) and gift wraps (kind 1059) only to their authenticated recipients #nip42_dms = false [verified_users] diff --git a/src/info.rs b/src/info.rs index 35f6430..2801415 100644 --- a/src/info.rs +++ b/src/info.rs @@ -63,7 +63,7 @@ pub struct RelayInfo { /// Convert an Info configuration into public Relay Info impl From for RelayInfo { fn from(c: Settings) -> Self { - let mut supported_nips = vec![1, 2, 9, 11, 12, 15, 16, 20, 22, 33, 40, 42]; + let mut supported_nips = vec![1, 2, 9, 11, 12, 15, 16, 20, 22, 33, 40]; if c.authorization.nip42_auth { supported_nips.push(42); diff --git a/src/server.rs b/src/server.rs index 1fd0cd5..e3318af 100644 --- a/src/server.rs +++ b/src/server.rs @@ -1034,7 +1034,7 @@ fn allowed_to_send(event_str: &String, conn: &conn::ClientConn, settings: &Setti if settings.authorization.nip42_dms { match serde_json::from_str::(event_str) { Ok(event) => { - if event.kind == 4 { + if event.kind == 4 || event.kind == 44 || event.kind == 1059 { match (conn.auth_pubkey(), event.tag_values_by_name("p").first()) { (Some(auth_pubkey), Some(recipient_pubkey)) => { recipient_pubkey == auth_pubkey || &event.pubkey == auth_pubkey