Compact code
This commit is contained in:
parent
c56101d227
commit
2bd2cbf84e
|
@ -160,12 +160,10 @@ class RoomGroupMessageCreator @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getRoomBitmap(events: List<NotifiableMessageEvent>): Bitmap? {
|
private fun getRoomBitmap(events: List<NotifiableMessageEvent>): Bitmap? {
|
||||||
if (events.isEmpty()) return null
|
|
||||||
|
|
||||||
// Use the last event (most recent?)
|
// Use the last event (most recent?)
|
||||||
val roomAvatarPath = events.last().roomAvatarPath
|
return events.lastOrNull()
|
||||||
|
?.roomAvatarPath
|
||||||
return bitmapLoader.getRoomBitmap(roomAvatarPath)
|
?.let { bitmapLoader.getRoomBitmap(it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue