put dm in separate menu.

fixed issue where new dm decryption was crashing when logged in with pubkey only.
This commit is contained in:
Vishal
2022-09-03 04:55:30 +05:30
parent 7457c78605
commit e4e5be6bf9
5 changed files with 69 additions and 34 deletions

View File

@@ -198,7 +198,10 @@ class EventData {
break;
case 4:
if( pubkey == userPublicKey) break; // crashes right now otherwise
if( userPrivateKey == ""){ // cant process if private key not given
break;
}
if( pubkey == userPublicKey ) break; // crashes right now otherwise
if(!isUserDirectMessage(this)) {
break;
}
@@ -540,7 +543,7 @@ String getAuthorName(String pubkey, [int len = 3]) {
Set<String> getPublicKeyFromName(String userName) {
Set<String> pubkeys = {};
if(gDebug >= 0) print("In getPublicKeyFromName: doing lookup for $userName len of gKindONames= ${gKindONames.length}");
//if(gDebug > 0) print("In getPublicKeyFromName: doing lookup for $userName len of gKindONames= ${gKindONames.length}");
gKindONames.forEach((pk, userInfo) {
// check both the user name, and the pubkey to search for the user
@@ -550,7 +553,7 @@ Set<String> getPublicKeyFromName(String userName) {
}
if( userName.length <= pk.length) {
print("$pk $userName" );
//print("$pk $userName" );
if( pk.substring(0, userName.length) == userName) {
pubkeys.add(pk);
}