update ktlint plugin to 11.3.1, format code (#3442)

This commit is contained in:
Konrad Pozniak 2023-03-13 13:16:39 +01:00 committed by GitHub
commit d839f18267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
141 changed files with 589 additions and 428 deletions

View file

@ -82,7 +82,7 @@ data class AccountEntity(
var pushPubKey: String = "",
var pushPrivKey: String = "",
var pushAuth: String = "",
var pushServerKey: String = "",
var pushServerKey: String = ""
) {
val identifier: String

View file

@ -66,7 +66,6 @@ class AccountManager @Inject constructor(db: AppDatabase) {
oauthScopes: String,
newAccount: Account
) {
activeAccount?.let {
it.isActive = false
Log.d(TAG, "addAccount: saving account with id " + it.id)
@ -121,7 +120,6 @@ class AccountManager @Inject constructor(db: AppDatabase) {
* @return the new active account, or null if no other account was found
*/
fun logActiveAccountOut(): AccountEntity? {
return activeAccount?.let { account ->
account.logout()
@ -167,7 +165,6 @@ class AccountManager @Inject constructor(db: AppDatabase) {
* @param accountId the database id of the new active account
*/
fun setActiveAccount(accountId: Long) {
val newActiveAccount = accounts.find { (id) ->
id == accountId
} ?: return // invalid accountId passed, do nothing
@ -237,10 +234,12 @@ class AccountManager @Inject constructor(db: AppDatabase) {
fun shouldDisplaySelfUsername(context: Context): Boolean {
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
val showUsernamePreference = sharedPreferences.getString(PrefKeys.SHOW_SELF_USERNAME, "disambiguate")
if (showUsernamePreference == "always")
if (showUsernamePreference == "always") {
return true
if (showUsernamePreference == "never")
}
if (showUsernamePreference == "never") {
return false
}
return accounts.size > 1 // "disambiguate"
}

View file

@ -43,7 +43,7 @@ data class DraftEntity(
val failedToSendNew: Boolean,
val scheduledAt: String?,
val language: String?,
val statusId: String?,
val statusId: String?
)
/**

View file

@ -85,7 +85,7 @@ data class TimelineStatusEntity(
val pinned: Boolean,
val card: String?,
val language: String?,
val filtered: List<FilterResult>?,
val filtered: List<FilterResult>?
) {
val isPlaceholder: Boolean
get() = this.authorServerId == null