mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-03-27 02:01:51 +01:00
Put in test so that DM sent to invalid pubkeys aren't taken as valid
invalid here means pubkeys with too many 0's in beginning ( 32 right now)
This commit is contained in:
parent
f305437862
commit
d7c60c6096
@ -1423,7 +1423,9 @@ bool isValidDirectMessage(EventData directMessageData) {
|
||||
});
|
||||
|
||||
if( directMessageData.pubkey == userPublicKey && allPtags.length == 1) {
|
||||
validUserMessage = true; // case where this user is sender
|
||||
if( allPtags[0].substring(0, 32) != "0".padLeft(32, '0')) { // check that the message hasn't been sent to an invalid pubkey
|
||||
validUserMessage = true; // case where this user is sender
|
||||
}
|
||||
} else {
|
||||
if ( directMessageData.pubkey != userPublicKey) {
|
||||
if( allPtags.length == 1 && allPtags[0] == userPublicKey) {
|
||||
@ -1526,7 +1528,7 @@ try {
|
||||
String myEncrypt( String privateString,
|
||||
String publicString,
|
||||
String plainText) {
|
||||
print("private = ${privateString.length} public = ${publicString.length}");
|
||||
//print("private = ${privateString.length} public = ${publicString.length}");
|
||||
Uint8List uintInputText = convert.Utf8Encoder().convert(plainText);
|
||||
final encryptedString = myEncryptRaw(privateString, publicString, uintInputText);
|
||||
return encryptedString;
|
||||
|
@ -5,6 +5,7 @@ homepage: https://github.com/vishalxl/nostr_console
|
||||
|
||||
# Release 0.1.3-beta
|
||||
# nip05 build
|
||||
# key 1 crashes fixed
|
||||
|
||||
environment:
|
||||
sdk: '>=2.17.3 <3.0.0'
|
||||
|
Loading…
x
Reference in New Issue
Block a user