improved profile for users whose contact list wasn't found

This commit is contained in:
Vishal 2024-04-21 10:41:37 +05:30
parent 151a00c22a
commit 9142fb3c24

View File

@ -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