mirror of
https://github.com/nextcloud/talk-android
synced 2025-01-31 11:32:00 +00:00
fix to use correct cloudId.
Without this fix, the avatars for "normal" messages were not able to show avatars. Only the messages that contained messageParameters with actor were able to show avatars(for example "userX invited userY") Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
870ef03d61
commit
c0c671bccf
@ -173,7 +173,7 @@ class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) :
|
||||
binding.messageUserAvatar.loadChangelogBotAvatar()
|
||||
} else if (message.actorType == "bots") {
|
||||
binding.messageUserAvatar.loadBotsAvatar()
|
||||
} else if (message.actorType == "federated_users" && message.messageParameters?.get("actor") != null) {
|
||||
} else if (message.actorType == "federated_users") {
|
||||
binding.messageUserAvatar.loadFederatedUserAvatar(message)
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) :
|
||||
binding.messageUserAvatar.loadChangelogBotAvatar()
|
||||
} else if (message.actorType == "bots") {
|
||||
binding.messageUserAvatar.loadBotsAvatar()
|
||||
} else if (message.actorType == "federated_users" && message.messageParameters?.get("actor") != null) {
|
||||
} else if (message.actorType == "federated_users") {
|
||||
binding.messageUserAvatar.loadFederatedUserAvatar(message)
|
||||
}
|
||||
} else {
|
||||
|
@ -180,7 +180,7 @@ class IncomingPollMessageViewHolder(incomingView: View, payload: Any) :
|
||||
binding.messageUserAvatar.loadChangelogBotAvatar()
|
||||
} else if (message.actorType == "bots") {
|
||||
binding.messageUserAvatar.loadBotsAvatar()
|
||||
} else if (message.actorType == "federated_users" && message.messageParameters?.get("actor") != null) {
|
||||
} else if (message.actorType == "federated_users") {
|
||||
binding.messageUserAvatar.loadFederatedUserAvatar(message)
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
|
||||
binding.messageUserAvatar.loadChangelogBotAvatar()
|
||||
} else if (message.actorType == "bots") {
|
||||
binding.messageUserAvatar.loadBotsAvatar()
|
||||
} else if (message.actorType == "federated_users" && message.messageParameters?.get("actor") != null) {
|
||||
} else if (message.actorType == "federated_users") {
|
||||
binding.messageUserAvatar.loadFederatedUserAvatar(message)
|
||||
}
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) :
|
||||
)
|
||||
binding.messageUserAvatar.visibility = View.VISIBLE
|
||||
binding.messageUserAvatar.setImageDrawable(drawable)
|
||||
} else if (message.actorType == "federated_users" && message.messageParameters?.get("actor") != null) {
|
||||
} else if (message.actorType == "federated_users") {
|
||||
binding.messageUserAvatar.loadFederatedUserAvatar(message)
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
|
||||
}
|
||||
if (ACTOR_TYPE_BOTS == message.actorType && ACTOR_ID_CHANGELOG == message.actorId) {
|
||||
userAvatar.loadChangelogBotAvatar()
|
||||
} else if (message.actorType == "federated_users" && message.messageParameters?.get("actor") != null) {
|
||||
} else if (message.actorType == "federated_users") {
|
||||
userAvatar.loadFederatedUserAvatar(message)
|
||||
}
|
||||
}
|
||||
|
@ -128,10 +128,7 @@ fun ImageView.loadUserAvatar(
|
||||
}
|
||||
|
||||
fun ImageView.loadFederatedUserAvatar(message: ChatMessage): io.reactivex.disposables.Disposable {
|
||||
val map = message.messageParameters?.get("actor")
|
||||
val url = map?.get("server")!!
|
||||
val id = map["id"]
|
||||
val cloudId = "$id@$url"
|
||||
val cloudId = message.actorId!!
|
||||
val darkTheme = if (DisplayUtils.isDarkModeOn(context)) 1 else 0
|
||||
val ignoreCache = false
|
||||
val requestBigSize = true
|
||||
|
Loading…
Reference in New Issue
Block a user