Skip to content

Commit

Permalink
Merge pull request #1391 from matrix-org/hs/drop-presence-list
Browse files Browse the repository at this point in the history
Drop presence list methods
  • Loading branch information
turt2live authored Jun 3, 2020
2 parents 19fe9b8 + d021498 commit 29f10bc
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 @@ -3518,46 +3518,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 29f10bc

Please sign in to comment.