flutter_firebase_chat_core icon indicating copy to clipboard operation
flutter_firebase_chat_core copied to clipboard

About Message Deletion

Open sinapsis793 opened this issue 3 years ago • 2 comments
trafficstars

Hello,

Is there a way to delete the messaging history from a user? If User A should be able to see the messages, even if user B deletes them.

sinapsis793 avatar Jul 29 '22 10:07 sinapsis793

Hello! By default I thought that delete will remove the message from both users, so you basically delete a document from the Firebase. If you want a behaviour you described above, I think you will need to use metadata map available on the message, and when user B deletes a message he updates its metadata to isDeleted: userId for example, and you filter out these messages in the stream using logged in user ID, and for user A they will still be visible, because he will have different user ID. Something like that.

demchenkoalex avatar Aug 08 '22 18:08 demchenkoalex

Hello, Thank you for your help. I will try it.

sinapsis793 avatar Aug 09 '22 06:08 sinapsis793