Skip to content

Commit 00125a3

Browse files
committed
fix: fetched follows info.
added user to 2->1 menu option too.
1 parent 04fb89f commit 00125a3

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

bin/nostr_console.dart

+5-6
Original file line numberDiff line numberDiff line change
@@ -380,21 +380,20 @@ Future<void> main(List<String> arguments) async {
380380
}
381381

382382
// get only limited number of contacts otherwise relays get less responsive
383-
int maxContactsFetched = 500;
383+
int maxContactsFetched = 700;
384384
if( contacts.length > maxContactsFetched) {
385385
int i = 0;
386-
contacts.retainWhere((element) => i++ > maxContactsFetched); // retain only first 200, whichever they may be
386+
contacts.retainWhere((element) => i++ < maxContactsFetched); // retain only first 200, whichever they may be
387387
}
388388

389389
getMultiUserEvents(gListRelayUrls2, contacts.union(gDefaultFollows).union(pTags).difference(usersFetched), 4 * limitPerSubscription, getSecondsDaysAgo(limitOthersEvents));
390390
usersFetched = usersFetched.union(gDefaultFollows).union(contacts).union(pTags);
391391

392392
// get meta events of all users fetched
393-
getMultiUserEvents(gListRelayUrls1, usersFetched, 4 * limitPerSubscription, getSecondsDaysAgo(limitSelfEvents*2), {0,3});
393+
getMultiUserEvents(gListRelayUrls1, usersFetched, 10 * limitPerSubscription, getSecondsDaysAgo(limitSelfEvents*100), {0,3});
394394
//print("fetched meta of ${usersFetched.length}");
395395

396396

397-
398397
void resetRelays() {
399398
relays.closeAll();
400399

@@ -421,12 +420,12 @@ Future<void> main(List<String> arguments) async {
421420

422421
String req = '["REQ","latest_live_all",{"limit":40000,"kinds":[0,1,3,4,5,6,7,40,41,42,104,140,141,142],"since":${getTimeSecondsAgo(gSecsLatestLive).toString()}}]';
423422
sendRequest(gListRelayUrls1, req);
423+
//getMultiUserEvents(gListRelayUrls1, usersFetched, 10 * limitPerSubscription, getSecondsDaysAgo(limitSelfEvents*100), {0,3});
424424

425425
// Create tree from all events that's have yet been received/accumulated
426426
Store node = getTree(initialEvents);
427427
gStore = node;
428-
429-
clearEvents();
428+
430429
mainMenuUi(node);
431430
});
432431
});

lib/console_ui.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ Future<void> socialMenuUi(Store node) async {
13251325

13261326
switch(option) {
13271327
case 1:
1328-
bool selectorTrees_followActionsNoNotifications (Tree t) => t.treeSelectorUserPostAndLike(getFollows( userPublicKey).union(gDefaultFollows), enableNotifications: false);
1328+
bool selectorTrees_followActionsNoNotifications (Tree t) => t.treeSelectorUserPostAndLike(getFollows( userPublicKey).union(gDefaultFollows).union({userPublicKey}), enableNotifications: false);
13291329
node.printStoreTrees(0, DateTime.now().subtract(Duration(hours:gHoursDefaultPrint)), selectorTrees_followActionsNoNotifications);
13301330
await processAnyIncomingEvents(node, true);
13311331
break;

pubspec.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nostr_console
22
description: A multi-platform nostr client built for terminal/console
3-
version: 0.3.4-beta
3+
version: 0.3.5-beta
44
homepage: https://github.com/vishalxl/nostr_console
55

66

@@ -9,6 +9,8 @@ homepage: https://github.com/vishalxl/nostr_console
99
# improved highlighted events code in 2->1
1010
# in 2->1 printed popular accounts with follows
1111
# difficulty limit set to 32
12+
# added three new relays and removed some older ones
13+
# fixed fetching of contact names ( now all are fetched whereas previously they werent)
1214

1315
# 0.3.4
1416
# improved logic that only new events from follows are shown; this reduces the flood of notifications seen

0 commit comments

Comments
 (0)