Created a function to easily get the name of a conversation

This commit is contained in:
Pierre HUBERT 2019-01-24 18:14:53 +01:00
parent 5640580397
commit f79ef55e3b

View File

@ -54,6 +54,27 @@ ComunicWeb.components.conversations.utils = {
return true;
},
/**
* Given a conversation ID, get its name
*
* @param {number} id The ID of the target conversation
* @param {function} onGotName Function called once we have got the name of the conversation
*/
getNameForID: function(id, onGotName){
ComunicWeb.components.conversations.interface.getInfosOne(id, function(info){
//Check if an error occurred
if(info.error)
return onGotName(false);
//Get and return the name of the conversation
ComunicWeb.components.conversations.utils.getName(info, onGotName);
});
},
/**
* Create and display a conversation creation / edition form
*