Commit f6753e2f authored by Utkarsh Barsaiyan's avatar Utkarsh Barsaiyan

Remove @with in UiModelMapper

parent dfcda352
...@@ -13,6 +13,7 @@ import androidx.core.text.buildSpannedString ...@@ -13,6 +13,7 @@ import androidx.core.text.buildSpannedString
import androidx.core.text.color import androidx.core.text.color
import androidx.core.text.scale import androidx.core.text.scale
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.app.RocketChatApplication.Companion.context
import chat.rocket.android.chatroom.domain.MessageReply import chat.rocket.android.chatroom.domain.MessageReply
import chat.rocket.android.dagger.scope.PerFragment import chat.rocket.android.dagger.scope.PerFragment
import chat.rocket.android.helper.MessageHelper import chat.rocket.android.helper.MessageHelper
...@@ -45,6 +46,8 @@ import kotlinx.coroutines.experimental.CommonPool ...@@ -45,6 +46,8 @@ import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.withContext import kotlinx.coroutines.experimental.withContext
import okhttp3.HttpUrl import okhttp3.HttpUrl
import java.security.InvalidParameterException import java.security.InvalidParameterException
import java.util.*
import java.util.Collections.emptyList
import javax.inject.Inject import javax.inject.Inject
@PerFragment @PerFragment
...@@ -341,14 +344,11 @@ class UiModelMapper @Inject constructor( ...@@ -341,14 +344,11 @@ class UiModelMapper @Inject constructor(
} }
private fun attachmentText(attachment: FileAttachment): String? { private fun attachmentText(attachment: FileAttachment): String? {
return with(attachment) { return attachment.text
return@with text
}
} }
private fun attachmentDescription(attachment: FileAttachment): String? { private fun attachmentDescription(attachment: FileAttachment): String? {
return with(attachment) { return attachment.description
return@with description
}
} }
private suspend fun mapMessage(message: Message): MessageUiModel = withContext(CommonPool) { private suspend fun mapMessage(message: Message): MessageUiModel = withContext(CommonPool) {
......
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