mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 20:32:50 +02:00
d->m: Presence
This commit is contained in:
parent
f98c30cac3
commit
8ad0117fd2
6 changed files with 70 additions and 1 deletions
|
@ -408,6 +408,14 @@ async function setAccountData(type, content, mxid) {
|
|||
await mreq.mreq("PUT", `/client/v3/user/${mxid}/account_data/${type}`, content)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {"online" | "offline" | "unavailable"} presence
|
||||
* @param {string} mxid
|
||||
*/
|
||||
async function setPresence(presence, mxid) {
|
||||
await mreq.mreq("PUT", path(`/client/v3/presence/${mxid}/status`, mxid), {presence})
|
||||
}
|
||||
|
||||
module.exports.path = path
|
||||
module.exports.register = register
|
||||
module.exports.createRoom = createRoom
|
||||
|
@ -440,3 +448,4 @@ module.exports.ackEvent = ackEvent
|
|||
module.exports.getAlias = getAlias
|
||||
module.exports.getAccountData = getAccountData
|
||||
module.exports.setAccountData = setAccountData
|
||||
module.exports.setPresence = setPresence
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue