From 7a473d1aa89275ebf4665d7582bd7810ee95b2a9 Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 14 May 2018 17:23:33 +0200 Subject: [PATCH] Can query the server to refresh only a single conversation. --- .../js/components/conversations/interface.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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 *