mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-03-27 02:01:51 +01:00
improved profile for users whose contact list wasn't found
This commit is contained in:
parent
151a00c22a
commit
9142fb3c24
@ -397,6 +397,26 @@ void printProfile(Store node, String profilePubkey) {
|
||||
stdout.write("${getAuthorName(x.contactPubkey)}, ");
|
||||
}
|
||||
print("\n");
|
||||
} else {
|
||||
// check if you follow the other account
|
||||
Event? selfContactEvent = getContactEvent(userPublicKey);
|
||||
bool youFollowThem = false;
|
||||
|
||||
if( selfContactEvent != null) {
|
||||
List<Contact> selfContacts = selfContactEvent.eventData.contactList;
|
||||
for(int i = 0; i < selfContacts.length; i ++) {
|
||||
if( selfContacts[i].contactPubkey == profilePubkey) {
|
||||
youFollowThem = true;
|
||||
print("* You follow $authorName");
|
||||
}
|
||||
}
|
||||
|
||||
if( youFollowThem == false) {
|
||||
print("* You don't follow $authorName");
|
||||
}
|
||||
|
||||
print("* Their contact list was not found.\n");
|
||||
}
|
||||
}
|
||||
|
||||
// print followers
|
||||
|
Loading…
x
Reference in New Issue
Block a user