mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 20:35:16 +00:00
Can update following state
This commit is contained in:
@ -63,6 +63,33 @@ ComunicWeb.components.friends.list = {
|
||||
return this.__list;
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the follow status of a user
|
||||
*
|
||||
* @param {Integer} friendID The friend ID to respond
|
||||
* @param {Boolean} follow Specify whether the user has to be followed or not
|
||||
* @param {Function} callback Specify an action to do next
|
||||
* @return {Boolean} True for a success
|
||||
*/
|
||||
setFollowing: function(friendID, follow, callback){
|
||||
//Prepare the API request
|
||||
var apiURI = "friends/setFollowing"
|
||||
var params = {
|
||||
"friendID": friendID,
|
||||
};
|
||||
|
||||
if(follow == true)
|
||||
params.follow = "true";
|
||||
else
|
||||
params.follow = "false";
|
||||
|
||||
//Process request
|
||||
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
|
||||
|
||||
//Success
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Respond a friendship request
|
||||
*
|
||||
|
Reference in New Issue
Block a user