From 1f653b1065f79ba2d4e219ec8b448f2db453ed9a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 23 Jun 2023 11:44:07 -0500 Subject: [PATCH] Gate Nostr signing to Ditto --- app/soapbox/features/ui/index.tsx | 2 +- app/soapbox/utils/features.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index 6cd41dde5..b3ad6b8bf 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -423,7 +423,7 @@ const UI: React.FC = ({ children }) => { if (!userStream.current) { userStream.current = dispatch(connectUserStream({ statContext })); } - if (!nostrStream.current && window.nostr) { + if (!nostrStream.current && features.nostrSign && window.nostr) { nostrStream.current = dispatch(connectNostrStream()); } } diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index 1b42dd539..429dd2a1f 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -680,6 +680,12 @@ const getInstanceFeatures = (instance: Instance) => { v.software === MASTODON && gte(v.compatVersion, '3.3.0'), ]), + /** + * Ability to sign Nostr events over websocket. + * @see GET /api/v1/streaming?stream=nostr + */ + nostrSign: v.software === DITTO, + /** * Add private notes to accounts. * @see POST /api/v1/accounts/:id/note