From 9c7c92acd09292545d862c688d365ee436d8d1d5 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Tue, 20 Feb 2024 08:49:08 +1300 Subject: [PATCH] Update NIP-11 --- src/web.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/web.rs b/src/web.rs index c6149da..d0e74ab 100644 --- a/src/web.rs +++ b/src/web.rs @@ -102,6 +102,23 @@ fn build_rid(config: &Config) -> String { rid.push_str(unsafe { std::str::from_utf8_unchecked(pkh.as_slice()) }); rid.push('\"'); } + + // Limitation + rid.push(','); + rid.push_str("\"limitation\":{"); + { + rid.push_str("\"payment_required\":false,\"auth_required\":false,\"restricted_writes\":true,\"max_message_length\":1048576"); + rid.push_str(&format!( + ",\"max_subscriptions\":{}", + config.max_subscriptions + )); + } + rid.push('}'); + + // Retention + rid.push(','); + rid.push_str("\"retention\":[{\"time\": null}]"); + rid.push('}'); rid