Skip to content

Commit

Permalink
fix: negentropy version check
Browse files Browse the repository at this point in the history
  • Loading branch information
v0l committed Sep 20, 2024
1 parent 153a76a commit ed694e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/app/src/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,9 @@
"MI2jkA": {
"defaultMessage": "Not available:"
},
"MKDHEa": {
"defaultMessage": "Join Room"
},
"MP54GY": {
"defaultMessage": "Wallet password",
"description": "Wallet password input placeholder"
Expand Down Expand Up @@ -2426,5 +2429,8 @@
},
"zvCDao": {
"defaultMessage": "Automatically show latest notes"
},
"zx0myy": {
"defaultMessage": "Participants"
}
}
4 changes: 3 additions & 1 deletion packages/app/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion packages/system/src/relay-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export interface RelayInfo {
language_tags?: Array<string>;
tags?: Array<string>;
posting_policy?: string;
negentropy?: string;
negentropy?: number;
}
2 changes: 1 addition & 1 deletion packages/system/src/sync/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit ed694e5

Please sign in to comment.