@ -12,11 +12,8 @@ import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.view_conversation.view.*
import kotlinx.android.synthetic.main.view_profile_picture.view.*
import kotlinx.coroutines.*
import network.loki.messenger.R
import org.session.libsession.utilities.recipients.Recipient
import org.thoughtcrime.securesms.conversation.v2.utilities.MentionManagerUtilities.populateUserPublicKeyCacheIfNeeded
import org.thoughtcrime.securesms.conversation.v2.utilities.MentionUtilities.highlightMentions
import org.thoughtcrime.securesms.database.RecipientDatabase
import org.thoughtcrime.securesms.database.model.ThreadRecord
@ -42,8 +39,6 @@ class ConversationView : LinearLayout {
// region Updating
fun bind ( thread : ThreadRecord , isTyping : Boolean , glide : GlideRequests ) {
this . thread = thread
profilePictureView . glide = glide
post {
val unreadCount = thread . unreadCount
if ( thread . recipient . isBlocked ) {
accentView . setBackgroundResource ( R . color . destructive )
@ -93,14 +88,11 @@ class ConversationView : LinearLayout {
thread . isRead -> statusIndicatorImageView . setImageResource ( R . drawable . ic _filled _circle _check )
else -> statusIndicatorImageView . setImageResource ( R . drawable . ic _circle _check )
}
GlobalScope . launch ( Dispatchers . IO ) {
populateUserPublicKeyCacheIfNeeded ( thread . threadId , context ) // FIXME: This is a bad place to do this
withContext ( Dispatchers . Main ) {
post {
profilePictureView . glide = glide
profilePictureView . update ( thread . recipient , thread . threadId )
}
}
}
}
fun recycle ( ) {
profilePictureView . recycle ( )