Skip to content

Commit

Permalink
Drop presence lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Jun 1, 2020
1 parent 0d7cb2b commit d021498
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3511,46 +3511,6 @@ MatrixClient.prototype.setPresence = function(opts, callback) {
);
};

function _presenceList(callback, client, opts, method) {
const path = utils.encodeUri("/presence/list/$userId", {
$userId: client.credentials.userId,
});
return client._http.authedRequest(callback, method, path, undefined, opts);
}

/**
* Retrieve current user presence list.
* @param {module:client.callback} callback Optional.
* @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.getPresenceList = function(callback) {
return _presenceList(callback, this, undefined, "GET");
};

/**
* Add users to the current user presence list.
* @param {module:client.callback} callback Optional.
* @param {string[]} userIds
* @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.inviteToPresenceList = function(callback, userIds) {
const opts = {"invite": userIds};
return _presenceList(callback, this, opts, "POST");
};

/**
* Drop users from the current user presence list.
* @param {module:client.callback} callback Optional.
* @param {string[]} userIds
* @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
**/
MatrixClient.prototype.dropFromPresenceList = function(callback, userIds) {
const opts = {"drop": userIds};
return _presenceList(callback, this, opts, "POST");
};

/**
* Retrieve older messages from the given room and put them in the timeline.
Expand Down

0 comments on commit d021498

Please sign in to comment.