diff --git a/assets/js/components/conversations/interface.js b/assets/js/components/conversations/interface.js index 02f43162..2e75441e 100644 --- a/assets/js/components/conversations/interface.js +++ b/assets/js/components/conversations/interface.js @@ -120,8 +120,36 @@ ComunicWeb.components.conversations.interface = { } //Else, perform an API request - //TODO : implement ON NEXT DEVELOPMENT SESSION - console.log("Please implement me !!!!!!"); + var apiURI = "conversations/getInfosOne"; + var params = { + conversationID: conversationID, + }; + + //Perform the API request + ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, function(result){ + + //Check for errors + if(result.error){ + + //Log error + ComunicWeb.debug.logMessage("Couldn't get informations about the conversation number "+conversationID+" !") + + //Perform next action now + nextStep(result); + + return false; + } + + //Else it is a success + //Cache the result + ComunicWeb.components.conversations.interface.__conversationsList["conversation-"+conversationID] = result; + + //Perform next action + nextStep(result); + + return true; + + }); //Success return true; diff --git a/assets/js/components/conversations/manager.js b/assets/js/components/conversations/manager.js index bfecb07f..60b7124b 100644 --- a/assets/js/components/conversations/manager.js +++ b/assets/js/components/conversations/manager.js @@ -66,7 +66,7 @@ ComunicWeb.components.conversations.manager = { //Then, open any already active conversation var openedConversations = ComunicWeb.components.conversations.cachingOpened.getAll(); - console.log(openedConversations); + //Process opened conversations for(i in openedConversations){ if(i < openedConversations.length) @@ -156,6 +156,7 @@ ComunicWeb.components.conversations.manager = { if(informations.error){ //Display error notification ComunicWeb.common.notificationSystem.showNotification("Couldn't get informations about the conversation !", "danger"); + return false; } //Change the name of the conversation