Skip to content

Commit

Permalink
improved profile for users whose contact list wasn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalxl committed Apr 21, 2024
1 parent 151a00c commit 9142fb3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/console_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9142fb3

Please sign in to comment.