diff --git a/lib/console_ui.dart b/lib/console_ui.dart index 9730ba9..21cbef1 100644 --- a/lib/console_ui.dart +++ b/lib/console_ui.dart @@ -1184,28 +1184,35 @@ Future socialMenuUi(Store node) async { break; case 3: - + clearScreen(); String temp = userPublicKey; bool selectorTrees_userNotifications (Tree t) => t.treeSelectorRepliesAndLikes(temp); node.printTree(0, DateTime.now().subtract(Duration(days:gNumLastDays)), selectorTrees_userNotifications); break; case 4: + clearScreen(); node.printTree(0, DateTime.now().subtract(Duration(days:gNumLastDays)), selectorTrees_selfPosts); break; case 5: + clearScreen(); node.printTree(0, DateTime.now().subtract(Duration(days:gNumLastDays)), selectorTrees_userRepliesLikes); break; case 6: + clearScreen(); node.printTree(0, DateTime.now().subtract(Duration(days:gNumLastDays)), selectorTrees_followsPosts); break; case 7: // search word or event id + clearScreen(); stdout.write("Enter word(s) to search: "); String? $tempWords = stdin.readLineSync(); String words = $tempWords??""; if( words != "") { bool onlyWords (Tree t) => t.treeSelectorHasWords(words.toLowerCase()); - node.printTree(0, DateTime.now().subtract(Duration(days:gNumLastDays)), onlyWords); // search for last gNumLastDays only + int numPrinted = node.printTree(0, DateTime.now().subtract(Duration(days:gNumLastDays)), onlyWords); // search for last gNumLastDays only + if( numPrinted == 0) { + print("Word(s) not found in last $gNumLastDays days. Try increasing the number of days printed, from social network options to search further back into history.\n"); + } } else printWarning("Blank word entered. Try again."); break; @@ -1221,12 +1228,14 @@ Future socialMenuUi(Store node) async { break; */ case 8: // follow new contact + // in case the program was invoked with --pubkey, then user can't send messages if( userPrivateKey == "") { printWarning("Since no user private key has been supplied, posts/messages can't be sent. Invoke with --prikey"); break; } + clearScreen(); stdout.write("Enter username or first few letters of user's public key( or full public key): "); String? $tempUserName = stdin.readLineSync(); String userName = $tempUserName??""; @@ -1299,6 +1308,7 @@ Future socialMenuUi(Store node) async { break; case 9: // change number of days printed + clearScreen(); stdout.write("Enter number of days for which you want to see posts: "); String? $tempNumDays = stdin.readLineSync(); String newNumDays = $tempNumDays??""; @@ -1318,7 +1328,8 @@ Future socialMenuUi(Store node) async { break; case 10: - stdout.write("Type username or first few letters of user's public key( or full public key): "); + clearScreen(); + stdout.write("Printing profile of a user; type username or first few letters of user's public key( or full public key): "); String? $tempUserName = stdin.readLineSync(); String userName = $tempUserName??""; if( userName != "") { diff --git a/lib/settings.dart b/lib/settings.dart index 416b811..168046e 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -3,7 +3,7 @@ import 'package:logging/logging.dart'; // name of executable const String exename = "nostr_console"; -const String version = "0.1.7-beta"; +const String version = "0.1.8-beta"; int gDebug = 0; int gSpecificDebug = 0; diff --git a/lib/tree_ds.dart b/lib/tree_ds.dart index 45a2819..c0a8451 100644 --- a/lib/tree_ds.dart +++ b/lib/tree_ds.dart @@ -1439,8 +1439,10 @@ class Store { numPrinted += printTopPost(topPosts[i], depth, newerThan); } - if( numPrinted > 0) - print("\nTotal posts printed: $numPrinted for last $gNumLastDays days"); + if( numPrinted > 0) { + print("\nTotal posts printed: $numPrinted for last $gNumLastDays days\n."); + } + return numPrinted; } diff --git a/pubspec.yaml b/pubspec.yaml index f367ce2..386b8c1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,10 @@ name: nostr_console description: A multi-platform nostr client built for terminal/console. -version: 0.1.7-beta +version: 0.1.8-beta homepage: https://github.com/vishalxl/nostr_console -# Release 0.1.6-beta -# update when sending kind 1 -# improved url breaking +# Release 0.1.8-beta +# menu changed environment: sdk: '>=2.17.3 <3.0.0'