QuickBlox / quickblox-ios-sdk

QuickBlox iOS SDK for messaging and video calling
https://quickblox.com/developers/IOS
MIT License
397 stars 359 forks source link

Last message is not deleted on deleting the dialog #1360

Closed manohar-techahead closed 11 months ago

manohar-techahead commented 1 year ago

If a dialog is deleted and then next time chat with a user is initiated, new dialog still shows last message in dialog listing whereas in detailed chat it does not show that message Simulator Screen Shot - iPhone 14 Pro Max - 2023-08-24 at 15 54 11

VladimirNybozhinsky commented 1 year ago

Hi @manohar-techahead This is Vladimir from QuickBlox.

https://discord.gg/ZWZ3WpYZ9q

Please specify what type of dialog you are using? It's not clear from your description.

If you are using a private dialog, then this is absolutely expected behavior. Private conversations are not deleted from the server. You can even think of them in such a way that between all users in the system there have always been, are and will be private dialogues on the server.

And if the user deletes his private dialogue and then "creates" it again, he will receive the same dialogue from the server, which has the "last message" either from himself or from his opponent. And by the way, when a user deletes a private dialog, this does not mean that the opponent should delete it too (Depends on the application logic)

If you don't want to display the "last message" in this case, then you need to handle this case depending on the application idea.

For example, when you delete a private conversation and recreate it, you can send a "notification" message to it (for example, chatMessage.customParameters["notification_type" = "back_to_private_dialog") and save it on the server (for example, chatMessage .customParameters["save_to_history" ] = true) with a welcome text like: "Bob has joined the chat", and then this message will become the "last message". " and it will be displayed in the list of dialogues:

image

and on the chat screen there will be something like this

image Best regards, Vladimir

https://discord.gg/ZWZ3WpYZ9q