d->m typing notifications

This commit is contained in:
Cadence Ember 2023-09-17 23:07:33 +12:00
parent 7e3175eb20
commit cab96cbc9e
4 changed files with 33 additions and 0 deletions

View file

@ -149,6 +149,19 @@ async function redactEvent(roomID, eventID, mxid) {
return root.event_id
}
/**
* @param {string} roomID
* @param {boolean} isTyping
* @param {string} mxid
* @param {number} [duration] milliseconds
*/
async function sendTyping(roomID, isTyping, mxid, duration) {
await mreq.mreq("PUT", path(`/client/v3/rooms/${roomID}/typing/${mxid}`, mxid), {
typing: isTyping,
duration
})
}
async function profileSetDisplayname(mxid, displayname) {
await mreq.mreq("PUT", path(`/client/v3/profile/${mxid}/displayname`, mxid), {
displayname
@ -195,6 +208,7 @@ module.exports.getJoinedMembers = getJoinedMembers
module.exports.sendState = sendState
module.exports.sendEvent = sendEvent
module.exports.redactEvent = redactEvent
module.exports.sendTyping = sendTyping
module.exports.profileSetDisplayname = profileSetDisplayname
module.exports.profileSetAvatarUrl = profileSetAvatarUrl
module.exports.setUserPower = setUserPower