unignoreUser method
Unignore a user. This will clear the local cached messages and request them again from the server to avoid gaps in the timeline.
Implementation
Future<void> unignoreUser(String userId) async {
if (!userId.isValidSDNId) {
throw Exception('$userId is not a valid mxid!');
}
if (!ignoredUsers.contains(userId)) {
throw Exception('$userId is not in the ignore list!');
}
await setAccountData(userID!, 'm.ignored_user_list', {
'ignored_users': Map.fromEntries(
(ignoredUsers..remove(userId)).map((key) => MapEntry(key, {}))),
});
await clearCache();
return;
}