broadcastRemoveFollowedCommunity method

Future<ContactList?> broadcastRemoveFollowedCommunity(
  1. String toRemove,
  2. Iterable<String> relays,
  3. EventSigner signer
)

Implementation

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