mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +03:00
Moving matrix client info related component to core package
This commit is contained in:
parent
1e6fb99e3c
commit
0c6d49856c
9 changed files with 11 additions and 15 deletions
|
@ -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
|
|
@ -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(
|
|
@ -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")
|
|
@ -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."
|
|
@ -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
|
|
@ -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(),
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
Loading…
Add table
Reference in a new issue