broadcastRemoveContact method
Future<ContactList?>
broadcastRemoveContact(
- String toRemove,
- Iterable<
String> relays, - EventSigner signer
Implementation
Future<ContactList?> broadcastRemoveContact(String toRemove,
Iterable<String> relays, EventSigner signer) async {
ContactList? contactList = await ensureUpToDateContactListOrEmpty(signer);
if (contactList.contacts.contains(toRemove)) {
contactList.contacts.remove(toRemove);
contactList.loadedTimestamp = Helpers.now;
contactList.createdAt = Helpers.now;
await broadcastEvent(contactList.toEvent(), relays, signer);
await cacheManager.saveContactList(contactList);
}
return contactList;
}