Delete all the conversation within a chat

Hi,

I know how to delete a single message using ** MessageRepository.softDeleteMessage(messageId);** but I want to delete all the messages within a chat. Please do mention how it will be accomplished?

Best,

Aamir Shehzad

Hello @aamir.shehzad , we currently have only one delete function available. To delete all messages, you will need to loop through and delete them individually.

Hi,
Thanks for your response. Is there an efficient way of deleting the messages using this method? I assume that looping through all the messages one by one will take a considerable time.

Hello @aamir.shehzad , Unfortunately, at this time, there isn’t a more efficient method for deleting messages other than looping through them individually. We understand that this approach can be time-consuming, but it’s currently the only option available.

If you have any other questions or need further assistance, please feel free to reach out.

1 Like