Detekt: fix ConstructorParameterNaming
UserProperties fix is also in https://github.com/matrix-org/matrix-analytics-events/pull/62
This commit is contained in:
parent
6f3b9c78b0
commit
03ec9946ff
|
@ -22,15 +22,15 @@ package org.matrix.android.sdk.api.logger
|
||||||
* val loggerTag = LoggerTag("MyTag", LoggerTag.VOIP)
|
* val loggerTag = LoggerTag("MyTag", LoggerTag.VOIP)
|
||||||
* Timber.tag(loggerTag.value).v("My log message")
|
* Timber.tag(loggerTag.value).v("My log message")
|
||||||
*/
|
*/
|
||||||
open class LoggerTag(_value: String, parentTag: LoggerTag? = null) {
|
open class LoggerTag(name: String, parentTag: LoggerTag? = null) {
|
||||||
|
|
||||||
object SYNC : LoggerTag("SYNC")
|
object SYNC : LoggerTag("SYNC")
|
||||||
object VOIP : LoggerTag("VOIP")
|
object VOIP : LoggerTag("VOIP")
|
||||||
object CRYPTO : LoggerTag("CRYPTO")
|
object CRYPTO : LoggerTag("CRYPTO")
|
||||||
|
|
||||||
val value: String = if (parentTag == null) {
|
val value: String = if (parentTag == null) {
|
||||||
_value
|
name
|
||||||
} else {
|
} else {
|
||||||
"${parentTag.value}/$_value"
|
"${parentTag.value}/$name"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,13 +27,13 @@ import timber.log.Timber
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class RoomGuestAccessContent(
|
data class RoomGuestAccessContent(
|
||||||
// Required. Whether guests can join the room. One of: ["can_join", "forbidden"]
|
// Required. Whether guests can join the room. One of: ["can_join", "forbidden"]
|
||||||
@Json(name = "guest_access") val _guestAccess: String? = null
|
@Json(name = "guest_access") val guestAccessStr: String? = null
|
||||||
) {
|
) {
|
||||||
val guestAccess: GuestAccess? = when (_guestAccess) {
|
val guestAccess: GuestAccess? = when (guestAccessStr) {
|
||||||
"can_join" -> GuestAccess.CanJoin
|
"can_join" -> GuestAccess.CanJoin
|
||||||
"forbidden" -> GuestAccess.Forbidden
|
"forbidden" -> GuestAccess.Forbidden
|
||||||
else -> {
|
else -> {
|
||||||
Timber.w("Invalid value for GuestAccess: `$_guestAccess`")
|
Timber.w("Invalid value for GuestAccess: `$guestAccessStr`")
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,15 +22,15 @@ import timber.log.Timber
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class RoomHistoryVisibilityContent(
|
data class RoomHistoryVisibilityContent(
|
||||||
@Json(name = "history_visibility") val _historyVisibility: String? = null
|
@Json(name = "history_visibility") val historyVisibilityStr: String? = null
|
||||||
) {
|
) {
|
||||||
val historyVisibility: RoomHistoryVisibility? = when (_historyVisibility) {
|
val historyVisibility: RoomHistoryVisibility? = when (historyVisibilityStr) {
|
||||||
"world_readable" -> RoomHistoryVisibility.WORLD_READABLE
|
"world_readable" -> RoomHistoryVisibility.WORLD_READABLE
|
||||||
"shared" -> RoomHistoryVisibility.SHARED
|
"shared" -> RoomHistoryVisibility.SHARED
|
||||||
"invited" -> RoomHistoryVisibility.INVITED
|
"invited" -> RoomHistoryVisibility.INVITED
|
||||||
"joined" -> RoomHistoryVisibility.JOINED
|
"joined" -> RoomHistoryVisibility.JOINED
|
||||||
else -> {
|
else -> {
|
||||||
Timber.w("Invalid value for RoomHistoryVisibility: `$_historyVisibility`")
|
Timber.w("Invalid value for RoomHistoryVisibility: `$historyVisibilityStr`")
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ import timber.log.Timber
|
||||||
*/
|
*/
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class RoomJoinRulesContent(
|
data class RoomJoinRulesContent(
|
||||||
@Json(name = "join_rule") val _joinRules: String? = null,
|
@Json(name = "join_rule") val joinRulesStr: String? = null,
|
||||||
/**
|
/**
|
||||||
* If the allow key is an empty list (or not a list at all),
|
* If the allow key is an empty list (or not a list at all),
|
||||||
* then no users are allowed to join without an invite.
|
* then no users are allowed to join without an invite.
|
||||||
|
@ -35,14 +35,14 @@ data class RoomJoinRulesContent(
|
||||||
*/
|
*/
|
||||||
@Json(name = "allow") val allowList: List<RoomJoinRulesAllowEntry>? = null
|
@Json(name = "allow") val allowList: List<RoomJoinRulesAllowEntry>? = null
|
||||||
) {
|
) {
|
||||||
val joinRules: RoomJoinRules? = when (_joinRules) {
|
val joinRules: RoomJoinRules? = when (joinRulesStr) {
|
||||||
"public" -> RoomJoinRules.PUBLIC
|
"public" -> RoomJoinRules.PUBLIC
|
||||||
"invite" -> RoomJoinRules.INVITE
|
"invite" -> RoomJoinRules.INVITE
|
||||||
"knock" -> RoomJoinRules.KNOCK
|
"knock" -> RoomJoinRules.KNOCK
|
||||||
"private" -> RoomJoinRules.PRIVATE
|
"private" -> RoomJoinRules.PRIVATE
|
||||||
"restricted" -> RoomJoinRules.RESTRICTED
|
"restricted" -> RoomJoinRules.RESTRICTED
|
||||||
else -> {
|
else -> {
|
||||||
Timber.w("Invalid value for RoomJoinRules: `$_joinRules`")
|
Timber.w("Invalid value for RoomJoinRules: `$joinRulesStr`")
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ class RestrictedRoomPreset(val homeServerCapabilities: HomeServerCapabilities, v
|
||||||
type = EventType.STATE_ROOM_JOIN_RULES,
|
type = EventType.STATE_ROOM_JOIN_RULES,
|
||||||
stateKey = "",
|
stateKey = "",
|
||||||
content = RoomJoinRulesContent(
|
content = RoomJoinRulesContent(
|
||||||
_joinRules = RoomJoinRules.RESTRICTED.value,
|
joinRulesStr = RoomJoinRules.RESTRICTED.value,
|
||||||
allowList = restrictedList
|
allowList = restrictedList
|
||||||
).toContent()
|
).toContent()
|
||||||
)
|
)
|
||||||
|
|
|
@ -20,6 +20,6 @@ import com.squareup.moshi.JsonClass
|
||||||
|
|
||||||
@JsonClass(generateAdapter = false)
|
@JsonClass(generateAdapter = false)
|
||||||
sealed class LazyRoomSyncEphemeral {
|
sealed class LazyRoomSyncEphemeral {
|
||||||
data class Parsed(val _roomSyncEphemeral: RoomSyncEphemeral) : LazyRoomSyncEphemeral()
|
data class Parsed(val roomSyncEphemeral: RoomSyncEphemeral) : LazyRoomSyncEphemeral()
|
||||||
object Stored : LazyRoomSyncEphemeral()
|
object Stored : LazyRoomSyncEphemeral()
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,14 +16,16 @@
|
||||||
|
|
||||||
package org.matrix.android.sdk.internal.session.identity.model
|
package org.matrix.android.sdk.internal.session.identity.model
|
||||||
|
|
||||||
|
import com.squareup.moshi.Json
|
||||||
import com.squareup.moshi.JsonClass
|
import com.squareup.moshi.JsonClass
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
internal data class SignInvitationBody(
|
internal data class SignInvitationBody(
|
||||||
/**The Matrix user ID of the user accepting the invitation.*/
|
/** The Matrix user ID of the user accepting the invitation.*/
|
||||||
val mxid: String,
|
val mxid: String,
|
||||||
/**The token from the call to store- invite..*/
|
/** The token from the call to store- invite..*/
|
||||||
val token: String,
|
val token: String,
|
||||||
/** The private key, encoded as Unpadded base64. */
|
/** The private key, encoded as Unpadded base64. */
|
||||||
val private_key: String
|
@Json(name = "private_key")
|
||||||
|
val privateKey: String
|
||||||
)
|
)
|
||||||
|
|
|
@ -136,7 +136,7 @@ internal class DefaultStateService @AssistedInject constructor(@Assisted private
|
||||||
if (joinRules != null) {
|
if (joinRules != null) {
|
||||||
val body = if (joinRules == RoomJoinRules.RESTRICTED) {
|
val body = if (joinRules == RoomJoinRules.RESTRICTED) {
|
||||||
RoomJoinRulesContent(
|
RoomJoinRulesContent(
|
||||||
_joinRules = RoomJoinRules.RESTRICTED.value,
|
joinRulesStr = RoomJoinRules.RESTRICTED.value,
|
||||||
allowList = allowList
|
allowList = allowList
|
||||||
).toContent()
|
).toContent()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -55,7 +55,7 @@ internal data class SearchRequestRoomEvents(
|
||||||
* Requests the server return the current state for each room returned.
|
* Requests the server return the current state for each room returned.
|
||||||
*/
|
*/
|
||||||
@Json(name = "include_state")
|
@Json(name = "include_state")
|
||||||
val include_state: Boolean? = null
|
val includeState: Boolean? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests that the server partitions the result set based on the provided list of keys.
|
* Requests that the server partitions the result set based on the provided list of keys.
|
||||||
|
|
|
@ -213,7 +213,7 @@ internal class RoomSyncHandler @Inject constructor(
|
||||||
val isInitialSync = insertType == EventInsertType.INITIAL_SYNC
|
val isInitialSync = insertType == EventInsertType.INITIAL_SYNC
|
||||||
|
|
||||||
val ephemeralResult = (roomSync.ephemeral as? LazyRoomSyncEphemeral.Parsed)
|
val ephemeralResult = (roomSync.ephemeral as? LazyRoomSyncEphemeral.Parsed)
|
||||||
?._roomSyncEphemeral
|
?.roomSyncEphemeral
|
||||||
?.events
|
?.events
|
||||||
?.takeIf { it.isNotEmpty() }
|
?.takeIf { it.isNotEmpty() }
|
||||||
?.let { handleEphemeral(realm, roomId, it, insertType == EventInsertType.INITIAL_SYNC, aggregator) }
|
?.let { handleEphemeral(realm, roomId, it, insertType == EventInsertType.INITIAL_SYNC, aggregator) }
|
||||||
|
|
|
@ -64,9 +64,6 @@ naming:
|
||||||
VariableNaming:
|
VariableNaming:
|
||||||
# TODO Enable it
|
# TODO Enable it
|
||||||
active: false
|
active: false
|
||||||
ConstructorParameterNaming:
|
|
||||||
# TODO Enable it
|
|
||||||
active: false
|
|
||||||
TopLevelPropertyNaming:
|
TopLevelPropertyNaming:
|
||||||
# TODO Enable it
|
# TODO Enable it
|
||||||
active: false
|
active: false
|
||||||
|
|
|
@ -27,23 +27,23 @@ data class UserProperties(
|
||||||
/**
|
/**
|
||||||
* Whether the user has the favourites space enabled
|
* Whether the user has the favourites space enabled
|
||||||
*/
|
*/
|
||||||
val WebMetaSpaceFavouritesEnabled: Boolean? = null,
|
val webMetaSpaceFavouritesEnabled: Boolean? = null,
|
||||||
/**
|
/**
|
||||||
* Whether the user has the home space set to all rooms
|
* Whether the user has the home space set to all rooms
|
||||||
*/
|
*/
|
||||||
val WebMetaSpaceHomeAllRooms: Boolean? = null,
|
val webMetaSpaceHomeAllRooms: Boolean? = null,
|
||||||
/**
|
/**
|
||||||
* Whether the user has the home space enabled
|
* Whether the user has the home space enabled
|
||||||
*/
|
*/
|
||||||
val WebMetaSpaceHomeEnabled: Boolean? = null,
|
val webMetaSpaceHomeEnabled: Boolean? = null,
|
||||||
/**
|
/**
|
||||||
* Whether the user has the other rooms space enabled
|
* Whether the user has the other rooms space enabled
|
||||||
*/
|
*/
|
||||||
val WebMetaSpaceOrphansEnabled: Boolean? = null,
|
val webMetaSpaceOrphansEnabled: Boolean? = null,
|
||||||
/**
|
/**
|
||||||
* Whether the user has the people space enabled
|
* Whether the user has the people space enabled
|
||||||
*/
|
*/
|
||||||
val WebMetaSpacePeopleEnabled: Boolean? = null,
|
val webMetaSpacePeopleEnabled: Boolean? = null,
|
||||||
/**
|
/**
|
||||||
* The selected messaging use case during the onboarding flow.
|
* The selected messaging use case during the onboarding flow.
|
||||||
*/
|
*/
|
||||||
|
@ -82,11 +82,11 @@ data class UserProperties(
|
||||||
|
|
||||||
fun getProperties(): Map<String, Any>? {
|
fun getProperties(): Map<String, Any>? {
|
||||||
return mutableMapOf<String, Any>().apply {
|
return mutableMapOf<String, Any>().apply {
|
||||||
WebMetaSpaceFavouritesEnabled?.let { put("WebMetaSpaceFavouritesEnabled", it) }
|
webMetaSpaceFavouritesEnabled?.let { put("WebMetaSpaceFavouritesEnabled", it) }
|
||||||
WebMetaSpaceHomeAllRooms?.let { put("WebMetaSpaceHomeAllRooms", it) }
|
webMetaSpaceHomeAllRooms?.let { put("WebMetaSpaceHomeAllRooms", it) }
|
||||||
WebMetaSpaceHomeEnabled?.let { put("WebMetaSpaceHomeEnabled", it) }
|
webMetaSpaceHomeEnabled?.let { put("WebMetaSpaceHomeEnabled", it) }
|
||||||
WebMetaSpaceOrphansEnabled?.let { put("WebMetaSpaceOrphansEnabled", it) }
|
webMetaSpaceOrphansEnabled?.let { put("WebMetaSpaceOrphansEnabled", it) }
|
||||||
WebMetaSpacePeopleEnabled?.let { put("WebMetaSpacePeopleEnabled", it) }
|
webMetaSpacePeopleEnabled?.let { put("WebMetaSpacePeopleEnabled", it) }
|
||||||
ftueUseCaseSelection?.let { put("ftueUseCaseSelection", it.name) }
|
ftueUseCaseSelection?.let { put("ftueUseCaseSelection", it.name) }
|
||||||
numFavouriteRooms?.let { put("numFavouriteRooms", it) }
|
numFavouriteRooms?.let { put("numFavouriteRooms", it) }
|
||||||
numSpaces?.let { put("numSpaces", it) }
|
numSpaces?.let { put("numSpaces", it) }
|
||||||
|
|
|
@ -53,7 +53,7 @@ class AutoCompleter @AssistedInject constructor(
|
||||||
@Assisted val isInThreadTimeline: Boolean,
|
@Assisted val isInThreadTimeline: Boolean,
|
||||||
private val avatarRenderer: AvatarRenderer,
|
private val avatarRenderer: AvatarRenderer,
|
||||||
private val commandAutocompletePolicy: CommandAutocompletePolicy,
|
private val commandAutocompletePolicy: CommandAutocompletePolicy,
|
||||||
AutocompleteCommandPresenterFactory: AutocompleteCommandPresenter.Factory,
|
autocompleteCommandPresenterFactory: AutocompleteCommandPresenter.Factory,
|
||||||
private val autocompleteMemberPresenterFactory: AutocompleteMemberPresenter.Factory,
|
private val autocompleteMemberPresenterFactory: AutocompleteMemberPresenter.Factory,
|
||||||
private val autocompleteRoomPresenter: AutocompleteRoomPresenter,
|
private val autocompleteRoomPresenter: AutocompleteRoomPresenter,
|
||||||
private val autocompleteGroupPresenter: AutocompleteGroupPresenter,
|
private val autocompleteGroupPresenter: AutocompleteGroupPresenter,
|
||||||
|
@ -68,7 +68,7 @@ class AutoCompleter @AssistedInject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private val autocompleteCommandPresenter: AutocompleteCommandPresenter by lazy {
|
private val autocompleteCommandPresenter: AutocompleteCommandPresenter by lazy {
|
||||||
AutocompleteCommandPresenterFactory.create(isInThreadTimeline)
|
autocompleteCommandPresenterFactory.create(isInThreadTimeline)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var editText: EditText? = null
|
private var editText: EditText? = null
|
||||||
|
|
Loading…
Reference in New Issue