Moving matrix client info related component to core package

This commit is contained in:
Maxime NATUREL 2022-10-03 14:55:11 +02:00
parent 1e6fb99e3c
commit 0c6d49856c
9 changed files with 11 additions and 15 deletions

View file

@ -14,9 +14,8 @@
* limitations under the License.
*/
package im.vector.app.features.settings.devices.v2.details.extended
package im.vector.app.core.session.clientinfo
import MATRIX_CLIENT_INFO_KEY_PREFIX
import im.vector.app.core.di.ActiveSessionHolder
import org.matrix.android.sdk.api.session.events.model.toModel
import javax.inject.Inject

View file

@ -14,11 +14,10 @@
* limitations under the License.
*/
package im.vector.app.features.settings.devices.v2.details.extended
package im.vector.app.core.session.clientinfo
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import com.squareup.moshi.Moshi
@JsonClass(generateAdapter = true)
data class MatrixClientInfoContent(

View file

@ -14,6 +14,6 @@
* limitations under the License.
*/
package im.vector.app.features.settings.devices.v2.details.extended
package im.vector.app.core.session.clientinfo
class NoDeviceIdError : IllegalStateException("device id is empty")

View file

@ -14,7 +14,9 @@
* limitations under the License.
*/
package im.vector.app.core.session.clientinfo
/**
* Prefix for th key account data event which holds client info.
* Prefix for the key account data event which holds client info.
*/
const val MATRIX_CLIENT_INFO_KEY_PREFIX = "io.element.matrix_client_information."

View file

@ -14,9 +14,8 @@
* limitations under the License.
*/
package im.vector.app.features.settings.devices.v2.details.extended
package im.vector.app.core.session.clientinfo
import MATRIX_CLIENT_INFO_KEY_PREFIX
import im.vector.app.core.di.ActiveSessionHolder
import org.matrix.android.sdk.api.session.events.model.toContent
import javax.inject.Inject

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.app.features.settings.devices.v2.details.extended
package im.vector.app.core.session.clientinfo
import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.resources.AppNameProvider
@ -32,7 +32,6 @@ class UpdateMatrixClientInfoUseCase @Inject constructor(
private val setMatrixClientInfoUseCase: SetMatrixClientInfoUseCase,
) {
// TODO call the use case after signin + on app startup
suspend fun execute(): Result<Unit> = runCatching {
val clientInfo = MatrixClientInfoContent(
name = appNameProvider.getAppName(),

View file

@ -14,9 +14,8 @@
* limitations under the License.
*/
package im.vector.app.features.settings.devices.v2.details.extended
package im.vector.app.core.session.clientinfo
import MATRIX_CLIENT_INFO_KEY_PREFIX
import im.vector.app.test.fakes.FakeActiveSessionHolder
import org.amshove.kluent.shouldBe
import org.amshove.kluent.shouldBeEqualTo

View file

@ -14,9 +14,8 @@
* limitations under the License.
*/
package im.vector.app.features.settings.devices.v2.details.extended
package im.vector.app.core.session.clientinfo
import MATRIX_CLIENT_INFO_KEY_PREFIX
import im.vector.app.test.fakes.FakeActiveSessionHolder
import kotlinx.coroutines.test.runTest
import org.amshove.kluent.shouldBe

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package im.vector.app.features.settings.devices.v2.details.extended
package im.vector.app.core.session.clientinfo
import im.vector.app.core.resources.BuildMeta
import im.vector.app.test.fakes.FakeActiveSessionHolder