check for capability before reverting status

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-11-06 18:27:03 +01:00
parent 7a63a645fe
commit c4f4c857d3
No known key found for this signature in database
GPG key ID: F7AA2A8B65B50220
2 changed files with 35 additions and 33 deletions

View file

@ -284,6 +284,7 @@ class SetStatusDialogFragment :
} }
override fun revertStatus() { override fun revertStatus() {
if (isRestoreStatusAvailable(currentUser!!)) {
ncApi.revertStatus( ncApi.revertStatus(
credentials, credentials,
ApiUtils.getUrlForRevertStatus(currentUser?.baseUrl!!, currentStatus?.messageId) ApiUtils.getUrlForRevertStatus(currentUser?.baseUrl!!, currentStatus?.messageId)
@ -319,6 +320,7 @@ class SetStatusDialogFragment :
} }
}) })
} }
}
private fun setupGeneralStatusOptions() { private fun setupGeneralStatusOptions() {
binding.onlineStatus.setOnClickListener { setStatus(StatusType.ONLINE) } binding.onlineStatus.setOnClickListener { setStatus(StatusType.ONLINE) }