call in attachments
This commit is contained in:
@@ -142,9 +142,7 @@ object VkUtils {
|
||||
}
|
||||
BaseVkAttachmentItem.AttachmentType.VOICE -> {
|
||||
val voiceMessage = baseAttachment.voiceMessage ?: continue
|
||||
attachments += VkVoiceMessage(
|
||||
link = voiceMessage.link_mp3
|
||||
)
|
||||
attachments += voiceMessage.asVkVoiceMessage()
|
||||
}
|
||||
BaseVkAttachmentItem.AttachmentType.STICKER -> {
|
||||
val sticker = baseAttachment.sticker ?: continue
|
||||
@@ -180,9 +178,7 @@ object VkUtils {
|
||||
}
|
||||
BaseVkAttachmentItem.AttachmentType.CALL -> {
|
||||
val call = baseAttachment.call ?: continue
|
||||
attachments += VkCall(
|
||||
initiatorId = call.initiator_id
|
||||
)
|
||||
attachments += call.asVkCall()
|
||||
}
|
||||
BaseVkAttachmentItem.AttachmentType.GROUP_CALL_IN_PROGRESS -> {
|
||||
val groupCall = baseAttachment.groupCall ?: continue
|
||||
|
||||
@@ -5,7 +5,12 @@ import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class VkCall(
|
||||
val initiatorId: Int
|
||||
val initiatorId: Int,
|
||||
val receiverId: Int,
|
||||
val state: String,
|
||||
val time: Int,
|
||||
val duration: Int,
|
||||
val isVideo: Boolean
|
||||
) : VkAttachment() {
|
||||
|
||||
@IgnoredOnParcel
|
||||
|
||||
@@ -5,9 +5,18 @@ import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class VkVoiceMessage(
|
||||
val link: String
|
||||
val id: Int,
|
||||
val ownerId: Int,
|
||||
val duration: Int,
|
||||
val waveform: List<Int>,
|
||||
val linkOgg: String,
|
||||
val linkMp3: String,
|
||||
val accessKey: String,
|
||||
val transcriptState: String,
|
||||
val transcript: String
|
||||
) : VkAttachment() {
|
||||
|
||||
@IgnoredOnParcel
|
||||
val className: String = this::class.java.name
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.meloda.fast.api.model.base.attachments
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.meloda.fast.api.model.attachments.VkCall
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@@ -11,4 +12,15 @@ data class BaseVkCall(
|
||||
val time: Int,
|
||||
val duration: Int,
|
||||
val video: Boolean
|
||||
) : Parcelable
|
||||
) : Parcelable {
|
||||
|
||||
fun asVkCall() = VkCall(
|
||||
initiatorId = initiator_id,
|
||||
receiverId = receiver_id,
|
||||
state = state,
|
||||
time = time,
|
||||
duration = duration,
|
||||
isVideo = video
|
||||
)
|
||||
|
||||
}
|
||||
+16
-1
@@ -1,6 +1,7 @@
|
||||
package com.meloda.fast.api.model.base.attachments
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.meloda.fast.api.model.attachments.VkVoiceMessage
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@@ -14,4 +15,18 @@ data class BaseVkVoiceMessage(
|
||||
val access_key: String,
|
||||
val transcript_state: String,
|
||||
val transcript: String
|
||||
) : Parcelable
|
||||
) : Parcelable {
|
||||
|
||||
fun asVkVoiceMessage() = VkVoiceMessage(
|
||||
id = id,
|
||||
ownerId = owner_id,
|
||||
duration = duration,
|
||||
waveform = waveform,
|
||||
linkOgg = link_ogg,
|
||||
linkMp3 = link_mp3,
|
||||
accessKey = access_key,
|
||||
transcriptState = transcript_state,
|
||||
transcript = transcript
|
||||
)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user