adapt models to changed federation invitations API

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-03-26 15:18:48 +01:00 committed by backportbot[bot]
parent fac8d6daa8
commit 8bd5a32f2d
3 changed files with 30 additions and 29 deletions

View file

@ -21,15 +21,15 @@
package com.nextcloud.talk.invitation.data package com.nextcloud.talk.invitation.data
data class Invitation( data class Invitation(
var id: Int, var id: Int = 0,
var userId: String, var state: Int = 0,
var state: Int, var localCloudId: String? = null,
var localRoomId: Int, var localToken: String? = null,
var accessToken: String?, var remoteAttendeeId: Int = 0,
var remoteServerUrl: String, var remoteServerUrl: String? = null,
var remoteToken: String, var remoteToken: String? = null,
var remoteAttendeeId: Int, var roomName: String? = null,
var inviterCloudId: String, var userId: String? = null,
var inviterDisplayName: String, var inviterCloudId: String? = null,
var roomName: String var inviterDisplayName: String? = null
) )

View file

@ -66,16 +66,16 @@ class InvitationsRepositoryImpl(private val ncApi: NcApi) :
filteredInvitations.map { invitation -> filteredInvitations.map { invitation ->
Invitation( Invitation(
invitation.id, invitation.id,
invitation.userId!!,
invitation.state, invitation.state,
invitation.localRoomId, invitation.localCloudId!!,
invitation.accessToken!!, invitation.localToken!!,
invitation.remoteAttendeeId,
invitation.remoteServerUrl!!, invitation.remoteServerUrl!!,
invitation.remoteToken!!, invitation.remoteToken!!,
invitation.remoteAttendeeId, invitation.roomName!!,
invitation.userId!!,
invitation.inviterCloudId!!, invitation.inviterCloudId!!,
invitation.inviterDisplayName!!, invitation.inviterDisplayName!!
invitation.roomName!!
) )
} }
) )

View file

@ -29,27 +29,28 @@ import kotlinx.parcelize.Parcelize
data class Invitation( data class Invitation(
@JsonField(name = ["id"]) @JsonField(name = ["id"])
var id: Int = 0, var id: Int = 0,
@JsonField(name = ["userId"])
var userId: String? = null,
@JsonField(name = ["state"]) @JsonField(name = ["state"])
var state: Int = 0, var state: Int = 0,
@JsonField(name = ["localRoomId"]) @JsonField(name = ["localCloudId"])
var localRoomId: Int = 0, var localCloudId: String? = null,
@JsonField(name = ["accessToken"]) @JsonField(name = ["localToken"])
var accessToken: String? = null, var localToken: String? = null,
@JsonField(name = ["remoteAttendeeId"])
var remoteAttendeeId: Int = 0,
@JsonField(name = ["remoteServerUrl"]) @JsonField(name = ["remoteServerUrl"])
var remoteServerUrl: String? = null, var remoteServerUrl: String? = null,
@JsonField(name = ["remoteToken"]) @JsonField(name = ["remoteToken"])
var remoteToken: String? = null, var remoteToken: String? = null,
@JsonField(name = ["remoteAttendeeId"]) @JsonField(name = ["roomName"])
var remoteAttendeeId: Int = 0, var roomName: String? = null,
@JsonField(name = ["userId"])
var userId: String? = null,
@JsonField(name = ["inviterCloudId"]) @JsonField(name = ["inviterCloudId"])
var inviterCloudId: String? = null, var inviterCloudId: String? = null,
@JsonField(name = ["inviterDisplayName"]) @JsonField(name = ["inviterDisplayName"])
var inviterDisplayName: String? = null, var inviterDisplayName: String? = null
@JsonField(name = ["roomName"])
var roomName: String? = null
) : Parcelable { ) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(0, null, 0, 0, null, null, null, 0, null, null, null) constructor() : this(0, 0, null, null, 0, null, null, null, null, null, null)
} }