improve codacy score

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2021-05-09 17:39:44 +02:00
parent d29905d0fa
commit 3cb2023680
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
5 changed files with 18 additions and 17 deletions

View File

@ -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;

View File

@ -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(

View File

@ -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;

View File

@ -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 -> ""
}
}
}

View File

@ -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;