removeFromContacts method
- RxChat chat
Removes the User from this chat
from the contacts list of the
authenticated MyUser.
Only meaningful, if chat
is dialog.
Implementation
Future<void> removeFromContacts(RxChat chat) async {
if (!inContacts(chat)) {
return;
}
try {
final ChatContactId? contactId =
chat.members.values
.firstWhereOrNull((e) => e.user.id != me)
?.user
.user
.value
.contacts
.firstOrNull
?.id;
if (contactId != null) {
await _contactService.deleteContact(contactId);
}
} catch (e) {
MessagePopup.error(e);
rethrow;
}
}