diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt b/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt index 01991f8de..6b2372ed4 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt @@ -244,13 +244,14 @@ class ConversationItem( } else { model.lastMessage!!.activeUser = user - val text = if (model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType - .REGULAR_TEXT_MESSAGE - ) { - calculateRegularLastMessageText(appContext) - } else { - model.lastMessage!!.lastMessageDisplayText - } + val text = + if ( + model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType.REGULAR_TEXT_MESSAGE + ) { + calculateRegularLastMessageText(appContext) + } else { + model.lastMessage!!.lastMessageDisplayText + } holder.binding.dialogLastMessage.text = text } } else { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.kt b/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.kt index 8d84602d6..948bdd872 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.kt @@ -79,10 +79,12 @@ import javax.inject.Inject @AutoInjector(NextcloudTalkApplication::class) class AccountVerificationController(args: Bundle? = null) : BaseController( - R.layout.controller_account_verification, args + R.layout.controller_account_verification, + args ) { - private val binding: ControllerAccountVerificationBinding? by - viewBinding(ControllerAccountVerificationBinding::bind) + private val binding: ControllerAccountVerificationBinding? by viewBinding( + ControllerAccountVerificationBinding::bind + ) @Inject lateinit var ncApi: NcApi @@ -289,10 +291,8 @@ class AccountVerificationController(args: Bundle? = null) : BaseController( @SuppressLint("SetTextI18n") override fun onError(e: Throwable) { - binding?.progressText?.text = - """ ${binding?.progressText?.text} - """ - .trimIndent() + resources!!.getString(R.string.nc_display_name_not_stored) + binding?.progressText?.text = """ ${binding?.progressText?.text}""".trimIndent() + + resources!!.getString(R.string.nc_display_name_not_stored) abortVerification() } diff --git a/app/src/main/java/com/nextcloud/talk/jobs/ContactAddressBookWorker.kt b/app/src/main/java/com/nextcloud/talk/jobs/ContactAddressBookWorker.kt index 2fbc97b3b..b05258c45 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/ContactAddressBookWorker.kt +++ b/app/src/main/java/com/nextcloud/talk/jobs/ContactAddressBookWorker.kt @@ -451,40 +451,26 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar const val DELETE_ALL = "DELETE_ALL" fun run(context: Context) { - if (ContextCompat.checkSelfPermission( - context, - Manifest.permission.WRITE_CONTACTS - ) == PackageManager.PERMISSION_GRANTED && - ContextCompat.checkSelfPermission( - context, - Manifest.permission.READ_CONTACTS - ) == PackageManager.PERMISSION_GRANTED + if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) == + PackageManager.PERMISSION_GRANTED && + ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) == + PackageManager.PERMISSION_GRANTED ) { - WorkManager - .getInstance() - .enqueue( - OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java) - .setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build()) - .build() - ) + WorkManager.getInstance().enqueue( + OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java) + .setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build()).build() + ) } } fun checkPermission(activity: Activity, context: Context): Boolean { - if (ContextCompat.checkSelfPermission( - context, - Manifest.permission.WRITE_CONTACTS - ) != PackageManager.PERMISSION_GRANTED || - ContextCompat.checkSelfPermission( - context, - Manifest.permission.READ_CONTACTS - ) != PackageManager.PERMISSION_GRANTED + if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) != + PackageManager.PERMISSION_GRANTED || + ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) != + PackageManager.PERMISSION_GRANTED ) { activity.requestPermissions( - arrayOf( - Manifest.permission.WRITE_CONTACTS, - Manifest.permission.READ_CONTACTS - ), + arrayOf(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS), REQUEST_PERMISSION ) return false diff --git a/app/src/main/java/com/nextcloud/talk/models/json/capabilities/SpreedCapability.kt b/app/src/main/java/com/nextcloud/talk/models/json/capabilities/SpreedCapability.kt index 509687890..21078568b 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/capabilities/SpreedCapability.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/capabilities/SpreedCapability.kt @@ -37,7 +37,15 @@ data class SpreedCapability( @JsonField(name = ["features"]) var features: List?, @JsonField(name = ["config"]) - var config: HashMap>? + var config: HashMap< + String, + HashMap< + String, + @RawValue + @Contextual + Any + > + >? ) : Parcelable { // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' constructor() : this(null, null) diff --git a/app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt b/app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt index e571028be..01eab3bd7 100644 --- a/app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt @@ -298,7 +298,8 @@ class ProfileActivity : BaseActivity() { } binding.loadingContent.visibility = View.VISIBLE adapter!!.setData(createUserInfoDetails(userInfo)) - if (isAllEmpty( + if ( + isAllEmpty( arrayOf( userInfo?.displayName, userInfo?.phone,