Can get informations about a unique conversation

This commit is contained in:
Pierre 2017-06-16 19:11:41 +02:00
parent cfc1a3cda1
commit 87158e9982
2 changed files with 32 additions and 3 deletions

View File

@ -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;

View File

@ -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