mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-06-02 03:01:27 +02:00
increased ininital delay and improved print ui for enc groups
This commit is contained in:
parent
f7fae6beb2
commit
c692f13bd3
@ -286,7 +286,7 @@ Future<void> main(List<String> arguments) async {
|
||||
limitSelfEvents = 5;
|
||||
limitMetaInfoEvents = 3;
|
||||
limitFollowPosts = 3;
|
||||
gDefaultNumWaitSeconds = gDefaultNumWaitSeconds ~/16;
|
||||
gDefaultNumWaitSeconds = gDefaultNumWaitSeconds ~/5 ;
|
||||
}
|
||||
|
||||
// get event for user
|
||||
@ -300,10 +300,7 @@ Future<void> main(List<String> arguments) async {
|
||||
|
||||
// get group and meta info events
|
||||
getKindEvents([0, 3, 40, 41], gListRelayUrls1, 3 * limitPerSubscription, getSecondsDaysAgo(limitMetaInfoEvents)); // get all type 3 etc
|
||||
//getKindEvents([140, 141], gListRelayUrls1, 3 * limitPerSubscription, getSecondsDaysAgo(1)); // get all type 3 etc
|
||||
|
||||
getKindEvents([42], gListRelayUrls1, limitPerSubscription * 3, getSecondsDaysAgo( limitFollowPosts)); // get all type 3 etc
|
||||
//getKindEvents([142], gListRelayUrls1, limitPerSubscription * 3, getSecondsDaysAgo( 1)); // get all type 3 etc
|
||||
|
||||
getKindEvents([gSecretMessageKind], gListRelayUrls1, limitPerSubscription * 3, getSecondsDaysAgo( 3)); // get all type 3 etc
|
||||
|
||||
|
@ -447,6 +447,13 @@ int showMenu(List<String> menuOptions, String menuName, [String menuInfo = ""])
|
||||
}
|
||||
|
||||
void printPubkeys(Set<String> pubkey) {
|
||||
print("${myPadRight("pubkey",64)} ${myPadRight("name", 20)} ${myPadRight("about", 40)} ${myPadRight("Nip05", 30)}");
|
||||
pubkey.forEach( (x) => print("$x ${myPadRight(getAuthorName(x), 20)} ${myPadRight(gKindONames[x]?.about??"", 40)} ${myPadRight(gKindONames[x]?.nip05Id??"No", 30)}"));
|
||||
print("");
|
||||
}
|
||||
|
||||
void printPubkeyResult(Set<String> pubkey) {
|
||||
|
||||
if( pubkey.length == 0) {
|
||||
print("There is no pubkey for that given name.");
|
||||
return;
|
||||
@ -457,9 +464,7 @@ void printPubkeys(Set<String> pubkey) {
|
||||
print("There are ${pubkey.length} public keys for the given name, which are: ");
|
||||
}
|
||||
}
|
||||
print("${myPadRight("pubkey",64)} ${myPadRight("name", 20)} ${myPadRight("about", 40)} ${myPadRight("Nip05", 30)}");
|
||||
pubkey.forEach( (x) => print("$x ${myPadRight(getAuthorName(x), 20)} ${myPadRight(gKindONames[x]?.about??"", 40)} ${myPadRight(gKindONames[x]?.nip05Id??"No", 30)}"));
|
||||
print("");
|
||||
printPubkeys(pubkey);
|
||||
}
|
||||
|
||||
Future<void> otherOptionsMenuUi(Store node) async {
|
||||
@ -972,22 +977,21 @@ Future<void> encryptedChannelMenuUI(Store node) async {
|
||||
Set<String> participantPubkeys = channel.participants;
|
||||
print("Sending the shared secret again to: $participantPubkeys");
|
||||
await sendInvitesForEncryptedChannel(node, fullChannelId, participantPubkeys);
|
||||
continue; // get to next while loop to avoid cleascreen
|
||||
continue; // get to next while loop to avoid clearscreen
|
||||
|
||||
case '/members':
|
||||
clearScreen();
|
||||
print("\nMembers names and pubkeys:\n");
|
||||
for( String pubkey in channel.participants) {
|
||||
stdout.write("${getAuthorName(pubkey)} - $pubkey , ");
|
||||
}
|
||||
printPubkeys(channel.participants );
|
||||
print("");
|
||||
continue; // get to next while loop to avoid cleascreen
|
||||
continue; // get to next while loop to avoid clearscreen
|
||||
|
||||
case '/help':
|
||||
print("""\n /members - print names/pubkeys of all members
|
||||
print("""\n /members - print names/pubkeys of all members
|
||||
/add <pubkey1> <pubkey2> ... - Space-separated pubkeys are taken as new user pubkeys, and they're added to group (admin only).
|
||||
/reinvite all - send secret password to all again (admin only)
|
||||
""");
|
||||
continue; // get to next while loop to avoid cleascreen
|
||||
continue; // get to next while loop to avoid clearscreen
|
||||
|
||||
default:
|
||||
// send message to the given room
|
||||
@ -1280,7 +1284,7 @@ Future<void> socialMenuUi(Store node) async {
|
||||
if( userName != "") {
|
||||
Set<String> pubkey = getPublicKeyFromName(userName);
|
||||
|
||||
printPubkeys(pubkey);
|
||||
printPubkeyResult(pubkey);
|
||||
|
||||
if( pubkey.length > 1) {
|
||||
if( pubkey.length > 1) {
|
||||
@ -1353,7 +1357,7 @@ Future<void> socialMenuUi(Store node) async {
|
||||
if( userName != "") {
|
||||
Set<String> pubkey = getPublicKeyFromName(userName);
|
||||
|
||||
printPubkeys(pubkey);
|
||||
printPubkeyResult(pubkey);
|
||||
|
||||
if( pubkey.length > 1) {
|
||||
if( pubkey.length > 1) {
|
||||
|
@ -11,6 +11,7 @@ homepage: https://github.com/vishalxl/nostr_console
|
||||
# /help in enc groups
|
||||
# still fixing notifications
|
||||
# reset notifications for dm
|
||||
# increased ininital delay and improved print ui for enc groups
|
||||
|
||||
|
||||
environment:
|
||||
|
Loading…
x
Reference in New Issue
Block a user