Fix comparison of user ids.

This commit is contained in:
onurays 2020-02-13 17:57:38 +03:00
parent 983593d647
commit f28e4cf991

View file

@ -214,13 +214,13 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted
?.get("reason") as? String)
?.takeIf { it.isNotBlank() }
?.let { reason ->
when (timelineEvent.root.senderId == session.myUserId) {
when (timelineEvent.root.senderId == timelineEvent.root.unsignedData?.redactedEvent?.senderId) {
true -> stringProvider.getString(R.string.event_redacted_by_user_reason_with_reason, reason)
false -> stringProvider.getString(R.string.event_redacted_by_admin_reason_with_reason, reason)
}
}
?: run {
when (timelineEvent.root.senderId == session.myUserId) {
when (timelineEvent.root.senderId == timelineEvent.root.unsignedData?.redactedEvent?.senderId) {
true -> stringProvider.getString(R.string.event_redacted_by_user_reason)
false -> stringProvider.getString(R.string.event_redacted_by_admin_reason)
}