Created friends components utilities.

This commit is contained in:
Pierre 2018-03-07 19:42:18 +01:00
parent 4010ce9cbf
commit 411800b46f
3 changed files with 37 additions and 0 deletions

View File

@ -561,6 +561,13 @@ var ComunicWeb = {
*/ */
interface: { interface: {
//TODO : implement //TODO : implement
},
/**
* Friends utilities
*/
utils: {
//TODO : implement
} }
}, },

View File

@ -0,0 +1,29 @@
/**
* Friends component utilities
*
* @author Pierre HUBERT
*/
ComunicWeb.components.friends.utils = {
/**
* Extract the IDs of the friends of the users from a friends list
*
* @param {array} list The friends list to process
* @return {array} The list of IDs
*/
getUsersIdFromPersonnalList: function(list){
//Parse the list
usersID = [];
list.forEach(friend => {
//Extract user id
usersID.push(friend.ID_friend);
});
//Return the generated list
return usersID;
},
}

View File

@ -216,6 +216,7 @@ class Dev {
"js/components/friends/friendsBar.js", "js/components/friends/friendsBar.js",
"js/components/friends/listModal.js", "js/components/friends/listModal.js",
"js/components/friends/interface.js", "js/components/friends/interface.js",
"js/components/friends/utils.js",
//Private conversations //Private conversations
"js/components/conversations/manager.js", "js/components/conversations/manager.js",