mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 09:58:51 +00:00
Created a function to easily get the name of a conversation
This commit is contained in:
parent
5640580397
commit
f79ef55e3b
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user