Merge pull request #4479 from nextcloud/bug_when_no_previous_user_status_set

Unable to change user status during a call
This commit is contained in:
Marcel Hibbe 2024-11-26 14:29:12 +01:00 committed by GitHub
commit 996720bf13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 13 deletions

View file

@ -18,7 +18,6 @@ import com.nextcloud.talk.chat.data.network.ChatNetworkDataSource
import com.nextcloud.talk.data.user.model.User
import com.nextcloud.talk.models.domain.ConversationModel
import com.nextcloud.talk.models.json.capabilities.SpreedCapability
import com.nextcloud.talk.models.json.generic.GenericOverall
import com.nextcloud.talk.models.json.participants.TalkBan
import com.nextcloud.talk.repositories.conversations.ConversationsRepository
import com.nextcloud.talk.utils.ApiUtils

View file

@ -176,18 +176,22 @@ class SetStatusDialogFragment :
@SuppressLint("NotifyDataSetChanged")
override fun onNext(statusOverall: StatusOverall) {
if (statusOverall.ocs?.meta?.statusCode == HTTP_STATUS_CODE_OK) {
backupStatus = statusOverall.ocs?.data!!
isBackupStatusAvailable = true
val backupPredefinedStatus = PredefinedStatus(
backupStatus.userId!!,
backupStatus.icon,
backupStatus.message!!,
ClearAt(type = "period", time = backupStatus.clearAt.toString())
)
binding.automaticStatus.visibility = View.VISIBLE
adapter.isBackupStatusAvailable = true
predefinedStatusesList.add(0, backupPredefinedStatus)
adapter.notifyDataSetChanged()
statusOverall.ocs?.data?.let { status ->
backupStatus = status
if (backupStatus.message != null) {
isBackupStatusAvailable = true
val backupPredefinedStatus = PredefinedStatus(
backupStatus.userId!!,
backupStatus.icon,
backupStatus.message!!,
ClearAt(type = "period", time = backupStatus.clearAt.toString())
)
binding.automaticStatus.visibility = View.VISIBLE
adapter.isBackupStatusAvailable = true
predefinedStatusesList.add(0, backupPredefinedStatus)
adapter.notifyDataSetChanged()
}
}
}
}