From 150ea1b887edf3e35203d7ebfb6575b9c99a45c7 Mon Sep 17 00:00:00 2001 From: Doug Hoyte Date: Wed, 4 Sep 2024 23:31:25 -0400 Subject: [PATCH] include negentropy protocol version in NIP-11 and landing page --- src/apps/relay/RelayWebsocket.cpp | 4 +++- src/tmpls/landing.tmpl | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/apps/relay/RelayWebsocket.cpp b/src/apps/relay/RelayWebsocket.cpp index 1dd4aef..e1a8e0d 100644 --- a/src/apps/relay/RelayWebsocket.cpp +++ b/src/apps/relay/RelayWebsocket.cpp @@ -56,6 +56,7 @@ void RelayServer::runWebsocket(ThreadPool::Thread &thr) { { "supported_nips", supportedNips }, { "software", "git+https://github.com/hoytech/strfry.git" }, { "version", APP_GIT_VERSION }, + { "negentropy", negentropy::PROTOCOL_VERSION - 0x60 }, { "limitation", tao::json::value({ { "max_message_length", cfg().relay__maxWebsocketPayloadSize }, { "max_subscriptions", cfg().relay__maxSubsPerConnection }, @@ -81,7 +82,8 @@ void RelayServer::runWebsocket(ThreadPool::Thread &thr) { struct { std::string supportedNips; std::string version; - } ctx = { tao::json::to_string(supportedNips), APP_GIT_VERSION }; + uint64_t negentropy; + } ctx = { tao::json::to_string(supportedNips), APP_GIT_VERSION, negentropy::PROTOCOL_VERSION - 0x60 }; rendered = preGenerateHttpResponse("text/html", ::strfrytmpl::landing(ctx).str); ver = cfg().version(); diff --git a/src/tmpls/landing.tmpl b/src/tmpls/landing.tmpl index e6be90c..fda6520 100644 --- a/src/tmpls/landing.tmpl +++ b/src/tmpls/landing.tmpl @@ -155,6 +155,11 @@ Supported NIPs $(ctx.supportedNips) + + + negentropy + $(ctx.negentropy) +