block method
Blocks the user for the authenticated MyUser.
Only meaningful, if this chat is a dialog.
Implementation
Future<void> block() async {
try {
if (user != null) {
final String text = reason.text.trim();
await _userService.blockUser(
user!.id,
text.isEmpty ? null : BlocklistReason(text),
);
}
reason.clear();
} on BlockUserException catch (e) {
MessagePopup.error(e);
} catch (e) {
MessagePopup.error(e);
rethrow;
}
}