Edit and delete messages
Vivox provides ways to edit and delete messages already sent to channels.
Edit channel messages
Vivox allows users to edit the text of messages they have sent into a channel using VivoxService.Instance.EditChannelTextMessageAsync(string channelName, string messageId, string newMessage)
. channelName being the name of the channel that the message was sent to, the messageId being the id of the message to change, and newMessage being the updated text of the message.
When a message has been successfully edited by anyone in a channel, everyone in the channel will receive a VivoxService.Instance.ChannelMessageEdited
Action containing the VivoxMessage that was edited, with the updated MessageText.
public async void UpdateChannelMessageAsync(VivoxMessage messageToUpdate, string updatedMessageText)
{
await VivoxService.Instance.EditChannelTextMessageAsync(messageToUpdate.ChannelName, messageToUpdate.MessageId, updatedMessageText);
}
Delete channel messages
Vivox allows for users to delete messages they have sent into a channel using VivoxService.Instance.DeleteChannelTextMessageAsync(string channelName, string messageId)
. channelName being the name of the channel that the message was sent to, and the messageId being the id of the message to delete.
When a message has been successfully deleted by anyone in a channel, everyone in the channel will receive a VivoxService.Instance.ChannelMessageDeleted
Action containing the VivoxMessage that was deleted.
public async void DeleteChannelMessageAsync(VivoxMessage messageToDelete)
{
await VivoxService.Instance.DeleteChannelTextMessageAsync(messageToDelete.ChannelName, messageToDelete.MessageId)
}