diff --git a/assets/js/components/conversations/interface.js b/assets/js/components/conversations/interface.js index 1a186e7c..3de7210c 100644 --- a/assets/js/components/conversations/interface.js +++ b/assets/js/components/conversations/interface.js @@ -343,6 +343,26 @@ ComunicWeb.components.conversations.interface = { ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback); }, + /** + * Get the the lastest messages of a single conversation + * + * @param {Number} convID Target conversation ID + * @param {Number} lastMessageID The ID of the last known message + * @param {function} callback + */ + refreshSingleConversation: function(convID, lastMessageID, callback){ + + //Perform a request on the API + var apiURI = "conversations/refresh_single"; + var params = { + conversationID: convID, + last_message_id: lastMessageID + }; + + ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback); + + }, + /** * Empty conversations cache *