broadcastAddFollowedCommunity method
Future<ContactList>
broadcastAddFollowedCommunity(
- String toAdd,
- Iterable<
String> relays, - EventSigner signer
Implementation
Future<ContactList> broadcastAddFollowedCommunity(String toAdd,
Iterable<String> relays, EventSigner signer) async {
ContactList contactList = await ensureUpToDateContactListOrEmpty(signer);
if (!contactList.followedCommunities.contains(toAdd)) {
contactList.followedCommunities.add(toAdd);
contactList.loadedTimestamp = Helpers.now;
contactList.createdAt = Helpers.now;
await broadcastEvent(contactList.toEvent(), relays, signer);
await cacheManager.saveContactList(contactList);
}
return contactList;
}