Skip to content

Commit

Permalink
fix: fetched follows info.
Browse files Browse the repository at this point in the history
added user to 2->1 menu option too.
  • Loading branch information
vishalxl committed Jan 17, 2023
1 parent 04fb89f commit 00125a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 5 additions & 6 deletions bin/nostr_console.dart
Original file line number Diff line number Diff line change
Expand Up @@ -380,21 +380,20 @@ Future<void> main(List<String> arguments) async {
}

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

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

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



void resetRelays() {
relays.closeAll();

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

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()}}]';
sendRequest(gListRelayUrls1, req);
//getMultiUserEvents(gListRelayUrls1, usersFetched, 10 * limitPerSubscription, getSecondsDaysAgo(limitSelfEvents*100), {0,3});

// Create tree from all events that's have yet been received/accumulated
Store node = getTree(initialEvents);
gStore = node;

clearEvents();

mainMenuUi(node);
});
});
Expand Down
2 changes: 1 addition & 1 deletion lib/console_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ Future<void> socialMenuUi(Store node) async {

switch(option) {
case 1:
bool selectorTrees_followActionsNoNotifications (Tree t) => t.treeSelectorUserPostAndLike(getFollows( userPublicKey).union(gDefaultFollows), enableNotifications: false);
bool selectorTrees_followActionsNoNotifications (Tree t) => t.treeSelectorUserPostAndLike(getFollows( userPublicKey).union(gDefaultFollows).union({userPublicKey}), enableNotifications: false);
node.printStoreTrees(0, DateTime.now().subtract(Duration(hours:gHoursDefaultPrint)), selectorTrees_followActionsNoNotifications);
await processAnyIncomingEvents(node, true);
break;
Expand Down
4 changes: 3 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nostr_console
description: A multi-platform nostr client built for terminal/console
version: 0.3.4-beta
version: 0.3.5-beta
homepage: https://github.com/vishalxl/nostr_console


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

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

0 comments on commit 00125a3

Please sign in to comment.