Create tag interface AccountDataContent

This commit is contained in:
Benoit Marty 2020-02-14 20:53:45 +01:00
parent 2d6f57e214
commit 446d826dd3
3 changed files with 26 additions and 2 deletions

View File

@ -19,6 +19,7 @@ package im.vector.matrix.android.api.session.securestorage
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import im.vector.matrix.android.internal.di.MoshiProvider
import im.vector.matrix.android.internal.session.user.accountdata.AccountDataContent
/**
* The account_data will have an encrypted property that is a map from key ID to an object.
@ -32,7 +33,7 @@ data class EncryptedSecretContent(
@Json(name = "ciphertext") val ciphertext: String? = null,
@Json(name = "mac") val mac: String? = null,
@Json(name = "ephemeral") val ephemeral: String? = null
) {
) : AccountDataContent {
companion object {
/**
* Facility method to convert from object which must be comprised of maps, lists,

View File

@ -17,8 +17,9 @@
package im.vector.matrix.android.internal.session.sync.model.accountdata
import com.squareup.moshi.Json
import im.vector.matrix.android.internal.session.user.accountdata.AccountDataContent
abstract class UserAccountData {
abstract class UserAccountData : AccountDataContent {
@Json(name = "type") abstract val type: String

View File

@ -0,0 +1,22 @@
/*
* Copyright (c) 2020 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.internal.session.user.accountdata
/**
* Tag class to identify every account data content
*/
internal interface AccountDataContent