Renaming userId into locationUserId in message location item

This commit is contained in:
Maxime NATUREL 2022-05-02 10:29:14 +02:00
parent 8b628229ed
commit adbc430ac8
3 changed files with 5 additions and 5 deletions

View file

@ -237,14 +237,14 @@ class MessageItemFactory @Inject constructor(
urlMapProvider.buildStaticMapUrl(it, INITIAL_MAP_ZOOM_IN_TIMELINE, width, height)
}
val userId = if (locationContent.isSelfLocation()) informationData.senderId else null
val locationUserId = if (locationContent.isSelfLocation()) informationData.senderId else null
return MessageLocationItem_()
.attributes(attributes)
.locationUrl(locationUrl)
.mapWidth(width)
.mapHeight(height)
.userId(userId)
.locationUserId(locationUserId)
.locationPinProvider(locationPinProvider)
.highlighted(highlight)
.leftGuideline(avatarSizeProvider.leftGuideline)

View file

@ -41,7 +41,7 @@ abstract class AbsMessageLocationItem<H : AbsMessageLocationItem.Holder> : AbsMe
var locationUrl: String? = null
@EpoxyAttribute
var userId: String? = null
var locationUserId: String? = null
@EpoxyAttribute
var mapWidth: Int = 0
@ -89,7 +89,7 @@ abstract class AbsMessageLocationItem<H : AbsMessageLocationItem.Holder> : AbsMe
target: Target<Drawable>?,
dataSource: DataSource?,
isFirstResource: Boolean): Boolean {
locationPinProvider?.create(userId) { pinDrawable ->
locationPinProvider?.create(locationUserId) { pinDrawable ->
// we are not using Glide since it does not display it correctly when there is no user photo
holder.staticMapPinImageView.setImageDrawable(pinDrawable)
}

View file

@ -39,7 +39,7 @@ abstract class MessageLiveLocationItem : AbsMessageLocationItem<MessageLiveLocat
private fun bindLocationLiveBanner(holder: Holder) {
// TODO add check on device id to confirm that is the one that sent the beacon
val isEmitter = currentUserId != null && currentUserId == userId
val isEmitter = currentUserId != null && currentUserId == locationUserId
val messageLayout = attributes.informationData.messageLayout
val viewState = buildViewState(holder, messageLayout, isEmitter)
holder.locationLiveMessageBanner.isVisible = true