quality: add missing doc
This commit is contained in:
parent
10b61df11b
commit
f8824e1ce1
1 changed files with 12 additions and 1 deletions
|
|
@ -23,6 +23,9 @@ import kotlinx.coroutines.flow.map
|
||||||
* Provides information about the permissions of users in a room.
|
* Provides information about the permissions of users in a room.
|
||||||
*/
|
*/
|
||||||
interface RoomPermissions : AutoCloseable {
|
interface RoomPermissions : AutoCloseable {
|
||||||
|
/**
|
||||||
|
* Returns true if the current user is able to ban from the room.
|
||||||
|
*/
|
||||||
fun canOwnUserBan(): Boolean
|
fun canOwnUserBan(): Boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,7 +34,7 @@ interface RoomPermissions : AutoCloseable {
|
||||||
fun canOwnUserInvite(): Boolean
|
fun canOwnUserInvite(): Boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the current user is able to kick in the room.
|
* Returns true if the current user is able to kick from the room.
|
||||||
*/
|
*/
|
||||||
fun canOwnUserKick(): Boolean
|
fun canOwnUserKick(): Boolean
|
||||||
|
|
||||||
|
|
@ -128,10 +131,18 @@ interface RoomPermissions : AutoCloseable {
|
||||||
fun canUserTriggerRoomNotification(userId: UserId): Boolean
|
fun canUserTriggerRoomNotification(userId: UserId): Boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the current user can edit roles and permissions in the room ie. can send
|
||||||
|
* a power levels state event.
|
||||||
|
*/
|
||||||
fun RoomPermissions.canEditRolesAndPermissions(): Boolean {
|
fun RoomPermissions.canEditRolesAndPermissions(): Boolean {
|
||||||
return canOwnUserSendState(StateEventType.ROOM_POWER_LEVELS)
|
return canOwnUserSendState(StateEventType.ROOM_POWER_LEVELS)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the current user can start a call in the room ie. can send
|
||||||
|
* a call member state event.
|
||||||
|
*/
|
||||||
fun RoomPermissions.canCall(): Boolean {
|
fun RoomPermissions.canCall(): Boolean {
|
||||||
return canOwnUserSendState(StateEventType.CALL_MEMBER)
|
return canOwnUserSendState(StateEventType.CALL_MEMBER)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue