mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-09 23:53:04 +00:00
improve codacy score
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
d29905d0fa
commit
3cb2023680
@ -62,7 +62,6 @@ import com.nextcloud.talk.models.json.autocomplete.AutocompleteUser;
|
||||
import com.nextcloud.talk.models.json.conversations.Conversation;
|
||||
import com.nextcloud.talk.models.json.conversations.RoomOverall;
|
||||
import com.nextcloud.talk.models.json.converters.EnumActorTypeConverter;
|
||||
import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter;
|
||||
import com.nextcloud.talk.models.json.participants.Participant;
|
||||
import com.nextcloud.talk.utils.ApiUtils;
|
||||
import com.nextcloud.talk.utils.ConductorRemapping;
|
||||
|
@ -715,7 +715,8 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
|
||||
}
|
||||
|
||||
if (participant.type == Participant.ParticipantType.MODERATOR ||
|
||||
participant.type == Participant.ParticipantType.GUEST_MODERATOR) {
|
||||
participant.type == Participant.ParticipantType.GUEST_MODERATOR
|
||||
) {
|
||||
ncApi.demoteAttendeeFromModerator(
|
||||
credentials,
|
||||
ApiUtils.getUrlForRoomModerators(
|
||||
@ -729,7 +730,8 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(subscriber)
|
||||
} else if (participant.type == Participant.ParticipantType.USER ||
|
||||
participant.type == Participant.ParticipantType.GUEST) {
|
||||
participant.type == Participant.ParticipantType.GUEST
|
||||
) {
|
||||
ncApi.promoteAttendeeToModerator(
|
||||
credentials,
|
||||
ApiUtils.getUrlForRoomModerators(
|
||||
|
@ -54,7 +54,6 @@ import com.nextcloud.talk.models.json.capabilities.Capabilities;
|
||||
import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
|
||||
import com.nextcloud.talk.models.json.conversations.Conversation;
|
||||
import com.nextcloud.talk.models.json.conversations.RoomOverall;
|
||||
import com.nextcloud.talk.models.json.generic.GenericOverall;
|
||||
import com.nextcloud.talk.models.json.participants.AddParticipantOverall;
|
||||
import com.nextcloud.talk.utils.ApiUtils;
|
||||
import com.nextcloud.talk.utils.ConductorRemapping;
|
||||
|
@ -2,7 +2,9 @@
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Joas Schilling
|
||||
* @author Andy Scherzinger
|
||||
* Copyright (C) 2021 Joas Schilling <coding@schilljs.com>
|
||||
* Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -30,12 +32,12 @@ import com.nextcloud.talk.models.json.participants.Participant.ActorType.USERS
|
||||
|
||||
class EnumActorTypeConverter : StringBasedTypeConverter<Participant.ActorType>() {
|
||||
override fun getFromString(string: String): Participant.ActorType {
|
||||
when (string) {
|
||||
"emails" -> return EMAILS
|
||||
"groups" -> return GROUPS
|
||||
"guests" -> return GUESTS
|
||||
"users" -> return USERS
|
||||
else -> return DUMMY
|
||||
return when (string) {
|
||||
"emails" -> EMAILS
|
||||
"groups" -> GROUPS
|
||||
"guests" -> GUESTS
|
||||
"users" -> USERS
|
||||
else -> DUMMY
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,12 +47,12 @@ class EnumActorTypeConverter : StringBasedTypeConverter<Participant.ActorType>()
|
||||
return ""
|
||||
}
|
||||
|
||||
when (`object`) {
|
||||
EMAILS -> return "emails"
|
||||
GROUPS -> return "groups"
|
||||
GUESTS -> return "guests"
|
||||
USERS -> return "users"
|
||||
else -> return ""
|
||||
return when (`object`) {
|
||||
EMAILS -> "emails"
|
||||
GROUPS -> "groups"
|
||||
GUESTS -> "guests"
|
||||
USERS -> "users"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
import com.nextcloud.talk.models.json.converters.EnumActorTypeConverter;
|
||||
import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter;
|
||||
import com.nextcloud.talk.models.json.converters.EnumSystemMessageTypeConverter;
|
||||
import com.nextcloud.talk.models.json.converters.ObjectParcelConverter;
|
||||
|
||||
import org.parceler.Parcel;
|
||||
|
Loading…
Reference in New Issue
Block a user