mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
Auto-review
This commit is contained in:
parent
4125baf066
commit
2e93b7c4c9
3 changed files with 26 additions and 36 deletions
|
@ -21,14 +21,14 @@ import im.vector.matrix.android.internal.crypto.model.rest.RestKeyInfo
|
|||
|
||||
internal object CryptoInfoMapper {
|
||||
|
||||
fun map(restDeviceInfo: DeviceKeysWithUnsigned): CryptoDeviceInfo {
|
||||
fun map(deviceKeysWithUnsigned: DeviceKeysWithUnsigned): CryptoDeviceInfo {
|
||||
return CryptoDeviceInfo(
|
||||
deviceId = restDeviceInfo.deviceId ?: "",
|
||||
userId = restDeviceInfo.userId ?: "",
|
||||
algorithms = restDeviceInfo.algorithms,
|
||||
keys = restDeviceInfo.keys,
|
||||
signatures = restDeviceInfo.signatures,
|
||||
unsigned = restDeviceInfo.unsigned,
|
||||
deviceId = deviceKeysWithUnsigned.deviceId,
|
||||
userId = deviceKeysWithUnsigned.userId,
|
||||
algorithms = deviceKeysWithUnsigned.algorithms,
|
||||
keys = deviceKeysWithUnsigned.keys,
|
||||
signatures = deviceKeysWithUnsigned.signatures,
|
||||
unsigned = deviceKeysWithUnsigned.unsigned,
|
||||
trustLevel = null
|
||||
)
|
||||
}
|
||||
|
|
|
@ -25,13 +25,13 @@ data class DeviceKeysWithUnsigned(
|
|||
* Required. The ID of the user the device belongs to. Must match the user ID used when logging in.
|
||||
*/
|
||||
@Json(name = "user_id")
|
||||
val userId: String?,
|
||||
val userId: String,
|
||||
|
||||
/**
|
||||
* Required. The ID of the device these keys belong to. Must match the device ID used when logging in.
|
||||
*/
|
||||
@Json(name = "device_id")
|
||||
val deviceId: String?,
|
||||
val deviceId: String,
|
||||
|
||||
/**
|
||||
* Required. The encryption algorithms supported by this device.
|
||||
|
|
|
@ -23,16 +23,16 @@ import io.realm.annotations.PrimaryKey
|
|||
|
||||
internal fun DeviceInfoEntity.Companion.createPrimaryKey(userId: String, deviceId: String) = "$userId|$deviceId"
|
||||
|
||||
// deviceInfoData contains serialized data
|
||||
internal open class DeviceInfoEntity(@PrimaryKey var primaryKey: String = "",
|
||||
internal open class DeviceInfoEntity(
|
||||
@PrimaryKey var primaryKey: String = "",
|
||||
var deviceId: String? = null,
|
||||
var identityKey: String? = null,
|
||||
// var deviceInfoData: String? = null,
|
||||
var userId: String? = null,
|
||||
var isBlocked: Boolean? = null,
|
||||
var algorithmListJson: String? = null,
|
||||
var keysMapJson: String? = null,
|
||||
var signatureMapJson: String? = null,
|
||||
// Will contain the device name from unsigned data if present
|
||||
var unsignedMapJson: String? = null,
|
||||
var trustLevelEntity: TrustLevelEntity? = null,
|
||||
/**
|
||||
|
@ -42,16 +42,6 @@ internal open class DeviceInfoEntity(@PrimaryKey var primaryKey: String = "",
|
|||
var firstTimeSeenLocalTs: Long? = null
|
||||
) : RealmObject() {
|
||||
|
||||
// // Deserialize data
|
||||
// fun getDeviceInfo(): MXDeviceInfo? {
|
||||
// return deserializeFromRealm(deviceInfoData)
|
||||
// }
|
||||
//
|
||||
// // Serialize data
|
||||
// fun putDeviceInfo(deviceInfo: MXDeviceInfo?) {
|
||||
// deviceInfoData = serializeForRealm(deviceInfo)
|
||||
// }
|
||||
|
||||
@LinkingObjects("devices")
|
||||
val users: RealmResults<UserEntity>? = null
|
||||
|
||||
|
|
Loading…
Reference in a new issue