mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-25 14:35:40 +03:00
Merge pull request #3822 from nextcloud/bugfix/noid/fixCanModerate
Bugfix/noid/fix can moderate
This commit is contained in:
commit
d8e6a4a135
1 changed files with 2 additions and 14 deletions
|
@ -22,9 +22,7 @@ import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter
|
|||
import com.nextcloud.talk.models.json.converters.EnumReadOnlyConversationConverter
|
||||
import com.nextcloud.talk.models.json.converters.EnumRoomTypeConverter
|
||||
import com.nextcloud.talk.models.json.participants.Participant.ParticipantType
|
||||
import com.nextcloud.talk.utils.SpreedFeatures
|
||||
import com.nextcloud.talk.utils.ConversationUtils
|
||||
import com.nextcloud.talk.utils.CapabilitiesUtil
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
|
@ -173,22 +171,12 @@ data class Conversation(
|
|||
ParticipantType.GUEST_MODERATOR == participantType ||
|
||||
ParticipantType.MODERATOR == participantType
|
||||
|
||||
@Deprecated("Use ConversationUtil")
|
||||
private fun isLockedOneToOne(conversationUser: User): Boolean {
|
||||
return type == ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL &&
|
||||
CapabilitiesUtil.hasSpreedFeatureCapability(
|
||||
conversationUser.capabilities?.spreedCapability!!,
|
||||
SpreedFeatures.LOCKED_ONE_TO_ONE_ROOMS
|
||||
)
|
||||
}
|
||||
|
||||
@Deprecated("Use ConversationUtil")
|
||||
fun canModerate(conversationUser: User): Boolean {
|
||||
return isParticipantOwnerOrModerator &&
|
||||
ConversationUtils.isLockedOneToOne(
|
||||
!ConversationUtils.isLockedOneToOne(
|
||||
ConversationModel.mapToConversationModel(this),
|
||||
conversationUser
|
||||
.capabilities?.spreedCapability!!
|
||||
conversationUser.capabilities?.spreedCapability!!
|
||||
) &&
|
||||
type != ConversationType.FORMER_ONE_TO_ONE &&
|
||||
!ConversationUtils.isNoteToSelfConversation(ConversationModel.mapToConversationModel(this))
|
||||
|
|
Loading…
Reference in a new issue