Unverified Commit c73a06ae authored by divyanshu bhargava's avatar divyanshu bhargava Committed by GitHub

Merge branch 'develop-2.x' into ver-name-number

parents cb3ee75c ca864422
...@@ -7,8 +7,8 @@ data class MessageAttachmentViewModel( ...@@ -7,8 +7,8 @@ data class MessageAttachmentViewModel(
override val message: Message, override val message: Message,
override val rawData: Message, override val rawData: Message,
override val messageId: String, override val messageId: String,
var senderName: String, var senderName: String?,
val time: CharSequence, val time: CharSequence?,
val content: CharSequence, val content: CharSequence,
val isPinned: Boolean, val isPinned: Boolean,
override var reactions: List<ReactionViewModel>, override var reactions: List<ReactionViewModel>,
......
...@@ -103,8 +103,8 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -103,8 +103,8 @@ class ViewModelMapper @Inject constructor(private val context: Context,
} }
private suspend fun mapMessageAttachment(message: Message, attachment: MessageAttachment): MessageAttachmentViewModel { private suspend fun mapMessageAttachment(message: Message, attachment: MessageAttachment): MessageAttachmentViewModel {
val attachmentAuthor = attachment.author!! val attachmentAuthor = attachment.author
val time = getTime(attachment.timestamp!!) val time = attachment.timestamp?.let { getTime(it) }
val attachmentText = when (attachment.attachments.orEmpty().firstOrNull()) { val attachmentText = when (attachment.attachments.orEmpty().firstOrNull()) {
is ImageAttachment -> context.getString(R.string.msg_preview_photo) is ImageAttachment -> context.getString(R.string.msg_preview_photo)
is VideoAttachment -> context.getString(R.string.msg_preview_video) is VideoAttachment -> context.getString(R.string.msg_preview_video)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment