remove method
Remove the message from the conversation.
The participant that calls this method should have:
- the VIConversationParticipant.canRemoveMessages permission to remove its own messages
- the VIConversationParticipant.canRemoveAllMessages permission to remove other participants' messages
Implementation
Future<VIMessageEvent> remove() async {
try {
Map<String, dynamic>? data = await _methodChannel.invokeMapMethod(
'Messaging.removeMessage',
{'conversation': conversation, 'message': uuid},
);
if (data == null) {
_VILog._e('VIMessage: remove: data was null, skipping');
throw VIException(
VIMessagingError.ERROR_INTERNAL,
'VIMessage:remove: data was null',
);
}
return VIMessageEvent._fromMap(data);
} on PlatformException catch (e) {
throw VIException(e.code, e.message);
}
}