Skip to content

Commit

Permalink
Implement image moderation on UI Components
Browse files Browse the repository at this point in the history
  • Loading branch information
JcMinarro committed Dec 16, 2024
1 parent 083f4db commit 6c8d206
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.getstream.chat.android.ui.feature.messages.list.adapter.viewholder.internal

import android.view.ViewGroup
import io.getstream.chat.android.ui.R
import io.getstream.chat.android.ui.databinding.StreamUiItemErrorMessageBinding
import io.getstream.chat.android.ui.feature.messages.list.MessageListItemStyle
import io.getstream.chat.android.ui.feature.messages.list.adapter.BaseMessageItemViewHolder
Expand All @@ -40,6 +41,8 @@ internal class ErrorMessageViewHolder(
if (!diff.syncStatus) return

val displayedText = data.message.getTranslatedText()
.takeUnless { it.isNullOrBlank() }
?: context.getString(R.string.stream_ui_message_list_error_blocked_by_moderation)
binding.messageTextView.text = displayedText
binding.messageTextView.setTextStyle(style.textStyleErrorMessage)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<string name="stream_ui_message_list_error_close_poll">Failed to close a poll</string>
<string name="stream_ui_message_list_error_cast_vote">Failed to cast a vote</string>
<string name="stream_ui_message_list_error_remove_vote">Failed to remove a vote</string>
<string name="stream_ui_message_list_error_blocked_by_moderation">This message was blocked by moderation policies</string>

<!-- Poll -->
<string name="stream_ui_poll_show_all_options">Show All Options</string>
Expand Down

0 comments on commit 6c8d206

Please sign in to comment.