diff --git a/lib/console_ui.dart b/lib/console_ui.dart index 7e4ecf5..af61d7f 100644 --- a/lib/console_ui.dart +++ b/lib/console_ui.dart @@ -599,13 +599,17 @@ Future otherOptionsMenuUi(Store node) async { case 6: //edit your profile print("Your current name: ${getAuthorName(userPublicKey)}"); - print("Your about me: ${gKindONames[userPublicKey]?.about}"); + print("Your 'about me': ${gKindONames[userPublicKey]?.about}"); print("Your current profile picture: ${gKindONames[userPublicKey]?.picture}\n"); + print("Your current NIP 05 id: ${gKindONames[userPublicKey]?.nip05Id}"); - String userName = getStringFromUser("Enter your new display name: "); - String userAbout = getStringFromUser("Enter new 'about me' for yourself: "); - String userPic = getStringFromUser("Enter url to your new display picture: ", "https://placekitten.com/200/200"); - String content = "{\"name\": \"$userName\", \"about\": \"$userAbout\", \"picture\": \"$userPic\"}"; + print("Enter new data. Leave blank to use the old value:"); + String userName = getStringFromUser("Enter your new display name: ", getAuthorName(userPublicKey)); + String userAbout = getStringFromUser("Enter new 'about me' for yourself: ", gKindONames[userPublicKey]?.about??""); + String userPic = getStringFromUser("Enter url to your new display picture: ", gKindONames[userPublicKey]?.picture??"https://placekitten.com/200/200"); + String nip05id = getStringFromUser("Enter your nip 05 id. Leave blank if unknown/none: ", gKindONames[userPublicKey]?.nip05Id??""); + + String content = "{\"name\": \"$userName\", \"about\": \"$userAbout\", \"picture\": \"$userPic\"${ nip05id.length >0 ? ", \"nip05\": \"$nip05id\"":""}}"; int createdAt = DateTime.now().millisecondsSinceEpoch ~/1000; EventData eventData = EventData('id', userPublicKey, createdAt, 0, content, [], [], [], [], {}, ); @@ -675,7 +679,7 @@ Future otherOptionsMenuUi(Store node) async { } print("Your name as seen in metadata event is: ${getAuthorName(userPublicKey)}\n"); - //printVerifiedAccounts(node); + printVerifiedAccounts(node); break; case 10: diff --git a/lib/event_ds.dart b/lib/event_ds.dart index 8157c06..a9fc18a 100644 --- a/lib/event_ds.dart +++ b/lib/event_ds.dart @@ -994,7 +994,7 @@ bool processKind0Event(Event e) { //print("got $urlNip05 for $name"); fetchNip05Info(urlNip05) .then((httpResponse) { - if( localDebug) print("-----\nnip future for $urlNip05 returned body ${httpResponse.body}"); + if( localDebug ) print("-----\nnip future for $urlNip05 returned body ${httpResponse.body}"); var namesInResponse; try { @@ -1393,15 +1393,16 @@ class Contact { } String addEscapeChars(String str) { - String temp = str.replaceAll("\"", "\\\""); - temp = temp.replaceAll("\\", "\\\\"); + String temp = ""; + //temp = temp.replaceAll("\\", "\\\\"); + temp = str.replaceAll("\"", "\\\""); return temp.replaceAll("\n", "\\n"); } String unEscapeChars(String str) { //print("in unEscape: |$str|"); String temp = str.replaceAll("\"", "\\\""); - temp = temp.replaceAll("\\\\", "\\"); + //temp = temp.replaceAll("\\\\", "\\"); temp = temp.replaceAll("\n", "\\n"); //print("returning |$temp|\n"); return temp;