QuickBlox / q-municate-android

Qmunicate Android chat application
MIT License
254 stars 197 forks source link

Delete Message - Listener in different platforms #253

Closed ayushishah-easternts closed 7 years ago

ayushishah-easternts commented 7 years ago

Hi ,

This would be regarding delete message.

If I delete message from qmunicate-web is there any way I can be informed in qmunicate-android that those particular messages are deleted , so that we can delete from ormlite in android. Our requirement is to keep android and web in sync , hence the question.

tatanka987 commented 7 years ago

you can realize this functionality via normal messages but without parameter saveToHostory=1. In your case user which deletes message should send message with additional parameters, for example (Android code):

            QBChatMessage messageAboutDelete = new QBChatMessage();
            messageAboutDelete.setProperty("notification_type", NOTIFICATION_DELETE_MESSAGE);
            messageAboutDelete.setProperty("delete_message_id", messageId);
            messageAboutDelete.setProperty("delete_message_dialog_id", dialogId);  

On other side when this message will received just check "notification_type" and remove message from ormlite.

ayushishah-easternts commented 7 years ago

Ok thanks !