From ed694e5f5db4f692877e7be899a2b107b5eba77d Mon Sep 17 00:00:00 2001 From: kieran Date: Fri, 20 Sep 2024 10:26:33 +0100 Subject: [PATCH] fix: negentropy version check --- packages/app/src/lang.json | 6 ++++++ packages/app/src/translations/en.json | 4 +++- packages/system/src/relay-info.ts | 2 +- packages/system/src/sync/connection.ts | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/app/src/lang.json b/packages/app/src/lang.json index 6fa500443..c188644d0 100644 --- a/packages/app/src/lang.json +++ b/packages/app/src/lang.json @@ -996,6 +996,9 @@ "MI2jkA": { "defaultMessage": "Not available:" }, + "MKDHEa": { + "defaultMessage": "Join Room" + }, "MP54GY": { "defaultMessage": "Wallet password", "description": "Wallet password input placeholder" @@ -2426,5 +2429,8 @@ }, "zvCDao": { "defaultMessage": "Automatically show latest notes" + }, + "zx0myy": { + "defaultMessage": "Participants" } } diff --git a/packages/app/src/translations/en.json b/packages/app/src/translations/en.json index df0e64793..48f38a84b 100644 --- a/packages/app/src/translations/en.json +++ b/packages/app/src/translations/en.json @@ -330,6 +330,7 @@ "M6C/px": "Become a leader", "MBAYRO": "Shows \"Copy ID\" and \"Copy Event JSON\" in the context menu on each message", "MI2jkA": "Not available:", + "MKDHEa": "Join Room", "MP54GY": "Wallet password", "MWTx65": "Default Page", "MYBYdJ": "Short Text Note", @@ -805,5 +806,6 @@ "zi9MdS": "Chess (PGN)", "zm6qS1": "{n} mins to read", "zonsdq": "Failed to load LNURL service", - "zvCDao": "Automatically show latest notes" + "zvCDao": "Automatically show latest notes", + "zx0myy": "Participants" } diff --git a/packages/system/src/relay-info.ts b/packages/system/src/relay-info.ts index 5974eea9e..2de719cf6 100644 --- a/packages/system/src/relay-info.ts +++ b/packages/system/src/relay-info.ts @@ -18,5 +18,5 @@ export interface RelayInfo { language_tags?: Array; tags?: Array; posting_policy?: string; - negentropy?: string; + negentropy?: number; } diff --git a/packages/system/src/sync/connection.ts b/packages/system/src/sync/connection.ts index 70fee5f3f..bf4e09d4b 100644 --- a/packages/system/src/sync/connection.ts +++ b/packages/system/src/sync/connection.ts @@ -14,7 +14,7 @@ export class DefaultSyncModule implements ConnectionSyncModule { sync(c: Connection, item: SyncCommand, cb?: () => void) { const [_, id, eventSet, ...filters] = item; - if (c.info?.negentropy === "v1") { + if ((c.info?.negentropy ?? NaN) >= 1) { const newFilters = filters; const neg = new NegentropyFlow(id, c, eventSet, newFilters); neg.once("finish", filters => {