Closed LagoonProject closed 1 week ago
Hi
https://developers.connectycube.com/reactnative/messaging/#remove-dialog
If other occupants are online while a dialog is deleting, the owner should send a system message to each occupant to inform them about the delete action. You can pass the deleted dialog ID to inform which dialog has to be removed from UI/DB
const message = {
extension: {
delete_dialog_by_id: dialogId,
},
};
ConnectyCube.chat.sendSystemMessage(userId, message);
thanks @ccvlad .
I think that's what I am doing but I don't get the expected result.
User A creates a group chat (type 2), with user B as an occupant => ConnectyCube.chat.dialog.create(params)
User A and User B see the dialog in their dialog list => ConnectyCube.chat.dialog.list({})
Then User A deletes the dialog => ConnectyCube.chat.dialog.delete(dialogId);
User A doesn't see the dialog anymore, but user B still see the dialog in its list when calling =>
ConnectyCube.chat.dialog.list({})
I'm not sure if I am missing something? The users are connect via firebase and user A appears as the owner of the group chat in the back end panel.
@LagoonProject
Try to do ConnectyCube.chat.dialog.delete(dialogId, {force: 1})
.
Unfortunately, we didn't specify the second argument in our docs, but it is in REST API docs, and react-native-connectycube
SDK has to support it. Please check with the force = 1
param and let us know about the result. I will update the docs if it works
@ccvlad Thanks so much, it works perfectly, I was missing {force: 1}, also works for type 3.
I'm glad to help you!
Thank you for your feedback. We will add note about this force = 1
param to our docs for React Native, JS, etc.
Hi,
1) To delete a group chat dialog I use this piece of code :
ConnectyCube.chat.dialog.delete(dialogId)
But even if the user is the owner, the dialog is removed for the user but remains for the other occupants. Is it possible to delete the dialog for all users with the React Native API ?
2) Side question : is it possible to remove a 1v1 chat dialog from the history ?
Thanks