mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Created a function to easily get the name of a conversation
This commit is contained in:
		@@ -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
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user