package com.discord.widgets.chat.list.adapter; import android.annotation.SuppressLint; import android.content.Context; import android.text.Spannable; import android.text.SpannableString; import android.text.method.LinkMovementMethod; import android.text.method.MovementMethod; import android.text.style.LeadingMarginSpan; import android.text.style.StyleSpan; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.LayoutRes; import androidx.core.text.BidiFormatter; import androidx.core.view.ViewCompat; import androidx.core.view.ViewKt; import c.a.k.b; import c.d.b.a.a; import com.discord.api.interaction.Interaction; import com.discord.api.message.LocalAttachment; import com.discord.api.user.User; import com.discord.api.utcdatetime.UtcDateTime; import com.discord.models.member.GuildMember; import com.discord.models.message.Message; import com.discord.models.user.CoreUser; import com.discord.stores.StoreMessageReplies; import com.discord.stores.StoreMessageState; import com.discord.stores.StoreStream; import com.discord.stores.StoreUserSettings; import com.discord.utilities.color.ColorCompat; import com.discord.utilities.guilds.PublicGuildUtils; import com.discord.utilities.icon.IconUtils; import com.discord.utilities.message.MessageUtils; import com.discord.utilities.textprocessing.DiscordParser; import com.discord.utilities.textprocessing.MessagePreprocessor; import com.discord.utilities.textprocessing.MessageRenderContext; import com.discord.utilities.textprocessing.node.SpoilerNode; import com.discord.utilities.time.TimeUtils; import com.discord.utilities.user.UserUtils; import com.discord.utilities.view.extensions.ViewExtensions; import com.discord.utilities.view.text.SimpleDraweeSpanTextView; import com.discord.views.FailedUploadList; import com.discord.views.typing.TypingDots; import com.discord.widgets.chat.list.ChatListItemMessageAccessibilityDelegate; import com.discord.widgets.chat.list.entries.ChatListEntry; import com.discord.widgets.chat.list.entries.MessageEntry; import com.discord.widgets.chat.list.utils.EmbeddedMessageParser; import com.facebook.drawee.span.DraweeSpanStringBuilder; import d0.z.d.m; import java.util.List; import java.util.Map; import kotlin.Unit; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.DefaultConstructorMarker; /* compiled from: WidgetChatListAdapterItemMessage.kt */ public final class WidgetChatListAdapterItemMessage extends WidgetChatListItem { public static final Companion Companion = new Companion(null); private static final int MAX_REPLY_AST_NODES = 50; private final View backgroundHighlight = this.itemView.findViewById(2131362540); private final FailedUploadList failedUploadList = ((FailedUploadList) this.itemView.findViewById(2131362537)); private final View gutterHighlight = this.itemView.findViewById(2131362538); private final TextView itemAlertText = ((TextView) this.itemView.findViewById(2131362526)); private final ImageView itemAvatar = ((ImageView) this.itemView.findViewById(2131362551)); private final TextView itemLoadingText = ((TextView) this.itemView.findViewById(2131362561)); private final TextView itemName = ((TextView) this.itemView.findViewById(2131362562)); private final TextView itemTag = ((TextView) this.itemView.findViewById(2131362564)); private final SimpleDraweeSpanTextView itemText; private final TextView itemTimestamp = ((TextView) this.itemView.findViewById(2131362565)); private final TypingDots loadingDots = ((TypingDots) this.itemView.findViewById(2131362617)); private final ImageView replyAvatar = ((ImageView) this.itemView.findViewById(2131362554)); private final View replyHolder = this.itemView.findViewById(2131362553); private final ImageView replyIcon = ((ImageView) this.itemView.findViewById(2131362555)); private final View replyLeadingViewsHolder = this.itemView.findViewById(2131362543); private final View replyLinkItem = this.itemView.findViewById(2131362556); private final TextView replyName = ((TextView) this.itemView.findViewById(2131362557)); private final SimpleDraweeSpanTextView replyText = ((SimpleDraweeSpanTextView) this.itemView.findViewById(2131362563)); private final ImageView sendError = ((ImageView) this.itemView.findViewById(2131362559)); private final ImageView threadEmbedSpine = ((ImageView) this.itemView.findViewById(2131362566)); private final View threadStarterMessageHeader = this.itemView.findViewById(2131365414); /* compiled from: WidgetChatListAdapterItemMessage.kt */ public static final class Companion { private Companion() { } public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public WidgetChatListAdapterItemMessage(@LayoutRes int i, WidgetChatListAdapter widgetChatListAdapter) { super(i, widgetChatListAdapter); m.checkNotNullParameter(widgetChatListAdapter, "adapter"); View findViewById = this.itemView.findViewById(2131362550); m.checkNotNullExpressionValue(findViewById, "itemView.findViewById(R.…t_list_adapter_item_text)"); this.itemText = (SimpleDraweeSpanTextView) findViewById; } public static final /* synthetic */ WidgetChatListAdapter access$getAdapter$p(WidgetChatListAdapterItemMessage widgetChatListAdapterItemMessage) { return (WidgetChatListAdapter) widgetChatListAdapterItemMessage.adapter; } public static final /* synthetic */ SimpleDraweeSpanTextView access$getItemText$p(WidgetChatListAdapterItemMessage widgetChatListAdapterItemMessage) { return widgetChatListAdapterItemMessage.itemText; } public static final /* synthetic */ SimpleDraweeSpanTextView access$getReplyText$p(WidgetChatListAdapterItemMessage widgetChatListAdapterItemMessage) { return widgetChatListAdapterItemMessage.replyText; } /* JADX DEBUG: Can't convert new array creation: APUT found in different block: 0x00ac: APUT (r3v4 java.lang.Object[]) (0 ??[int, short, byte, char]) (wrap: java.lang.String : 0x00a8: INVOKE (r10v14 java.lang.String) = (r10v13 java.util.Map), (r0v4 java.lang.Long) type: INTERFACE call: java.util.Map.get(java.lang.Object):java.lang.Object) */ private final TextView configureInteractionMessage(MessageEntry messageEntry) { int i; Message message = messageEntry.getMessage(); boolean shouldShowInteractionMessage = shouldShowInteractionMessage(message); TypingDots typingDots = this.loadingDots; if (typingDots != null) { ViewKt.setVisible(typingDots, shouldShowInteractionMessage); } if (shouldShowInteractionMessage) { TypingDots typingDots2 = this.loadingDots; if (typingDots2 != null) { int i2 = TypingDots.i; typingDots2.a(false); } } else { TypingDots typingDots3 = this.loadingDots; if (typingDots3 != null) { typingDots3.b(); } } TextView textView = this.itemLoadingText; if (textView != null) { ViewKt.setVisible(textView, shouldShowInteractionMessage); } this.itemText.setVisibility(shouldShowInteractionMessage ^ true ? 0 : 8); ImageView imageView = this.sendError; if (imageView != null) { ViewKt.setVisible(imageView, false); } if (!shouldShowInteractionMessage) { return this.itemText; } TextView textView2 = this.itemTag; if (textView2 != null) { ViewKt.setVisible(textView2, true); } if (message.isFailed()) { View view = this.itemView; m.checkNotNullExpressionValue(view, "itemView"); i = ColorCompat.getThemedColor(view, 2130968930); } else { View view2 = this.itemView; m.checkNotNullExpressionValue(view2, "itemView"); i = ColorCompat.getThemedColor(view2, 2130968988); } TextView textView3 = this.itemLoadingText; if (textView3 != null) { textView3.setTextColor(i); } if (message.isLocalApplicationCommand() && message.isLoading()) { TextView textView4 = this.itemLoadingText; if (textView4 != null) { Context context = this.itemText.getContext(); m.checkNotNullExpressionValue(context, "itemText.context"); Object[] objArr = new Object[1]; Map nickOrUsernames = messageEntry.getNickOrUsernames(); User author = message.getAuthor(); objArr[0] = nickOrUsernames.get(author != null ? Long.valueOf(author.i()) : null); textView4.setText(b.g(context, 2131886389, objArr, null, 4)); } ImageView imageView2 = this.sendError; if (imageView2 != null) { ViewKt.setVisible(imageView2, false); } } else if (message.isLocalApplicationCommand() && message.isFailed()) { TextView textView5 = this.itemLoadingText; if (textView5 != null) { textView5.setText(2131886379); } ImageView imageView3 = this.sendError; if (imageView3 != null) { ViewKt.setVisible(imageView3, true); } TypingDots typingDots4 = this.loadingDots; if (typingDots4 != null) { ViewKt.setInvisible(typingDots4, true); } TypingDots typingDots5 = this.loadingDots; if (typingDots5 != null) { typingDots5.b(); } } else if (message.isLocalApplicationCommand()) { TextView textView6 = this.itemLoadingText; if (textView6 != null) { textView6.setText(2131886380); } ImageView imageView4 = this.sendError; if (imageView4 != null) { ViewKt.setVisible(imageView4, false); } } TextView textView7 = this.itemLoadingText; return textView7 != null ? textView7 : this.itemText; } private final void configureItemTag(Message message) { if (this.itemTag != null) { User author = message.getAuthor(); m.checkNotNull(author); CoreUser coreUser = new CoreUser(author); boolean isPublicGuildSystemMessage = PublicGuildUtils.INSTANCE.isPublicGuildSystemMessage(message); this.itemTag.setVisibility(coreUser.isBot() || coreUser.isSystemUser() || isPublicGuildSystemMessage ? 0 : 8); this.itemTag.setText((coreUser.isSystemUser() || isPublicGuildSystemMessage) ? 2131893943 : 2131887053); this.itemTag.setCompoundDrawablesWithIntrinsicBounds(UserUtils.INSTANCE.isVerifiedBot(coreUser) ? 2131232066 : 0, 0, 0, 0); } } private final void configureReplyAuthor(com.discord.models.user.User user, GuildMember guildMember, MessageEntry messageEntry) { configureReplyAvatar(user, guildMember != null ? guildMember : messageEntry.getAuthor()); String str = (String) a.c(user, messageEntry.getNickOrUsernames()); if (str == null) { str = user.getUsername(); } boolean z2 = false; List mentions = messageEntry.getMessage().getMentions(); if (mentions != null) { for (User user2 : mentions) { if (user2.i() == user.getId()) { z2 = true; } } } configureReplyName(str, getAuthorTextColor(guildMember), z2); } private final void configureReplyAvatar(com.discord.models.user.User user, GuildMember guildMember) { ImageView imageView = this.replyIcon; if (imageView != null && this.replyAvatar != null) { if (user == null) { imageView.setVisibility(0); this.replyAvatar.setVisibility(8); return; } imageView.setVisibility(8); this.replyAvatar.setVisibility(0); IconUtils.setIcon$default(this.replyAvatar, user, 2131165294, null, null, guildMember, 24, null); } } private final void configureReplyContentWithResourceId(int i) { if (this.replyText != null) { Context context = this.replyText.getContext(); m.checkNotNullExpressionValue(context, "replyText.context"); SpannableString spannableString = new SpannableString(context.getResources().getString(i)); spannableString.setSpan(new StyleSpan(2), 0, spannableString.length(), 33); configureReplyText(spannableString, 0.64f); } } private final void configureReplyInteraction(MessageEntry messageEntry) { User c2; Message message = messageEntry.getMessage(); Interaction interaction = message.getInteraction(); if (interaction != null && (c2 = interaction.c()) != null) { GuildMember interactionAuthor = messageEntry.getInteractionAuthor(); CoreUser coreUser = new CoreUser(c2); configureReplyAvatar(new CoreUser(c2), messageEntry.getAuthor()); configureReplyAuthor(coreUser, interactionAuthor, messageEntry); TextView textView = this.replyName; if (textView != null) { textView.setOnClickListener(new WidgetChatListAdapterItemMessage$configureReplyInteraction$1(this, message)); } SimpleDraweeSpanTextView simpleDraweeSpanTextView = this.replyText; if (simpleDraweeSpanTextView != null) { MovementMethod instance = LinkMovementMethod.getInstance(); if (instance != null) { simpleDraweeSpanTextView.setMovementMethod(instance); } else { return; } } SimpleDraweeSpanTextView simpleDraweeSpanTextView2 = this.replyText; CharSequence c3 = simpleDraweeSpanTextView2 != null ? b.c(simpleDraweeSpanTextView2, 2131893947, new Object[]{interaction.b()}, new WidgetChatListAdapterItemMessage$configureReplyInteraction$content$1(this, interaction, message, c2)) : null; if (c3 != null) { SpannableString valueOf = SpannableString.valueOf(c3); m.checkExpressionValueIsNotNull(valueOf, "SpannableString.valueOf(this)"); if (valueOf != null) { configureReplyText(valueOf, 1.0f); } } } } private final void configureReplyLayoutDirection() { if (this.replyHolder != null && this.replyText != null) { this.replyHolder.setLayoutDirection(BidiFormatter.getInstance().isRtl(this.replyText.getText()) ? 1 : 0); } } @SuppressLint({"SetTextI18n"}) private final void configureReplyName(String str, int i, boolean z2) { if (this.replyName != null) { if (!(str == null || str.length() == 0)) { String str2 = z2 ? "@" : ""; this.replyName.setVisibility(0); TextView textView = this.replyName; textView.setText(str2 + str); this.replyName.setTextColor(i); return; } this.replyName.setVisibility(8); } } private final void configureReplyPreview(MessageEntry messageEntry) { Integer type; if (this.replyHolder != null && this.replyLinkItem != null) { Message message = messageEntry.getMessage(); MessageEntry.ReplyData replyData = messageEntry.getReplyData(); boolean isInteraction = message.isInteraction(); if (isInteraction || !(replyData == null || (type = messageEntry.getMessage().getType()) == null || type.intValue() != 19)) { this.replyHolder.setVisibility(0); this.replyLinkItem.setVisibility(0); if (isInteraction) { configureReplyInteraction(messageEntry); } else if (replyData != null) { MessageEntry messageEntry2 = replyData.getMessageEntry(); StoreMessageReplies.MessageState messageState = replyData.getMessageState(); if (replyData.isRepliedUserBlocked()) { configureReplySystemMessage(2131892762); } else if (messageState instanceof StoreMessageReplies.MessageState.Unloaded) { configureReplySystemMessage(2131892764); } else if (messageState instanceof StoreMessageReplies.MessageState.Deleted) { configureReplySystemMessage(2131892763); } else if ((messageState instanceof StoreMessageReplies.MessageState.Loaded) && messageEntry2 != null) { Message message2 = messageEntry2.getMessage(); this.replyHolder.setOnClickListener(new WidgetChatListAdapterItemMessage$configureReplyPreview$1(message2)); Integer type2 = message2.getType(); if (type2 != null && type2.intValue() == 7) { configureReplySystemMessageUserJoin(message2); return; } User author = message2.getAuthor(); m.checkNotNull(author); configureReplyAuthor(new CoreUser(author), messageEntry2.getAuthor(), messageEntry2); if (this.replyText != null && this.replyLeadingViewsHolder != null) { String content = message2.getContent(); if (content == null) { content = ""; } if (!(content.length() == 0)) { Context context = this.replyText.getContext(); EmbeddedMessageParser embeddedMessageParser = EmbeddedMessageParser.INSTANCE; m.checkNotNullExpressionValue(context, "context"); DraweeSpanStringBuilder parse = embeddedMessageParser.parse(new EmbeddedMessageParser.ParserData(context, messageEntry2.getRoles(), messageEntry2.getNickOrUsernames(), messageEntry2.getAnimateEmojis(), new StoreMessageState.State(null, null, 3, null), 50, message2, (WidgetChatListAdapter) this.adapter)); parse.setSpan(getLeadingEdgeSpan(), 0, parse.length(), 33); this.replyText.setDraweeSpanStringBuilder(parse); configureReplyLayoutDirection(); } else if (message2.hasStickers()) { configureReplyContentWithResourceId(2131892768); } else if (message2.hasAttachments() || message2.hasEmbeds()) { configureReplyContentWithResourceId(2131892766); } } } } } else { this.replyHolder.setVisibility(8); this.replyLinkItem.setVisibility(8); } } } private final void configureReplySystemMessage(int i) { configureReplyAvatar(null, null); configureReplyName("", 0, false); configureReplyContentWithResourceId(i); } private final void configureReplySystemMessageUserJoin(Message message) { ImageView imageView = this.replyIcon; if (imageView != null && this.replyAvatar != null && this.replyText != null) { imageView.setVisibility(8); this.replyAvatar.setVisibility(0); this.replyAvatar.setImageResource(2131231678); configureReplyName("", 0, false); Context context = this.replyText.getContext(); m.checkNotNullExpressionValue(context, "context"); int systemMessageUserJoin = MessageUtils.INSTANCE.getSystemMessageUserJoin(context, message.getId()); User author = message.getAuthor(); m.checkNotNull(author); configureReplyText(new SpannableString(b.g(context, systemMessageUserJoin, new Object[]{author.r()}, null, 4).toString()), 0.64f); } } private final void configureReplyText(Spannable spannable, float f) { if (this.replyText != null && this.replyLeadingViewsHolder != null) { spannable.setSpan(getLeadingEdgeSpan(), 0, spannable.length(), 33); this.replyText.setAlpha(f); this.replyText.setText(spannable); configureReplyLayoutDirection(); } } public static /* synthetic */ void configureReplyText$default(WidgetChatListAdapterItemMessage widgetChatListAdapterItemMessage, Spannable spannable, float f, int i, Object obj) { if ((i & 2) != 0) { f = 1.0f; } widgetChatListAdapterItemMessage.configureReplyText(spannable, f); } private final void configureThreadSpine(Message message, boolean z2) { ImageView imageView = this.threadEmbedSpine; if (imageView != null) { ViewKt.setVisible(imageView, message.hasThread() && !z2); } } private final int getAuthorTextColor(GuildMember guildMember) { View view = this.itemView; m.checkNotNullExpressionValue(view, "itemView"); return GuildMember.Companion.getColor(guildMember, ColorCompat.getThemedColor(view.getContext(), 2130968932)); } private final LeadingMarginSpan getLeadingEdgeSpan() { int i; View view = this.replyLeadingViewsHolder; if (view != null) { view.measure(0, 0); i = this.replyLeadingViewsHolder.getMeasuredWidth(); } else { i = 0; } return new LeadingMarginSpan.Standard(i, 0); } private final MessagePreprocessor getMessagePreprocessor(long j, Message message, StoreMessageState.State state) { StoreUserSettings userSettings = StoreStream.Companion.getUserSettings(); return new MessagePreprocessor(j, state, (!userSettings.getIsEmbedMediaInlined() || !userSettings.getIsRenderEmbedsEnabled()) ? null : message.getEmbeds(), true, (Integer) null); } private final MessageRenderContext getMessageRenderContext(Context context, MessageEntry messageEntry, Function1, Unit> function1) { return new MessageRenderContext(context, ((WidgetChatListAdapter) this.adapter).getData().getUserId(), messageEntry.getAnimateEmojis(), messageEntry.getNickOrUsernames(), ((WidgetChatListAdapter) this.adapter).getData().getChannelNames(), messageEntry.getRoles(), 2130968986, WidgetChatListAdapterItemMessage$getMessageRenderContext$1.INSTANCE, new WidgetChatListAdapterItemMessage$getMessageRenderContext$2(this), ColorCompat.getThemedColor(context, 2130970181), ColorCompat.getThemedColor(context, 2130970182), function1, new WidgetChatListAdapterItemMessage$getMessageRenderContext$3(this), new WidgetChatListAdapterItemMessage$getMessageRenderContext$4(context)); } private final Function1, Unit> getSpoilerClickHandler(Message message) { if (!((WidgetChatListAdapter) this.adapter).getData().isSpoilerClickAllowed()) { return null; } return new WidgetChatListAdapterItemMessage$getSpoilerClickHandler$1(this, message); } private final void processMessageText(SimpleDraweeSpanTextView simpleDraweeSpanTextView, MessageEntry messageEntry) { String str; Context context = simpleDraweeSpanTextView.getContext(); Message message = messageEntry.getMessage(); boolean isWebhook = message.isWebhook(); UtcDateTime editedTimestamp = message.getEditedTimestamp(); boolean z2 = true; int i = 0; boolean z3 = (editedTimestamp != null ? editedTimestamp.f() : 0) > 0; if (message.isSourceDeleted()) { m.checkNotNullExpressionValue(context, "context"); str = context.getResources().getString(2131893471); } else { str = message.getContent(); if (str == null) { str = ""; } } m.checkNotNullExpressionValue(str, "if (message.isSourceDele…ssage.content ?: \"\"\n }"); MessagePreprocessor messagePreprocessor = getMessagePreprocessor(((WidgetChatListAdapter) this.adapter).getData().getUserId(), message, messageEntry.getMessageState()); m.checkNotNullExpressionValue(context, "context"); DraweeSpanStringBuilder parseChannelMessage = DiscordParser.parseChannelMessage(context, str, getMessageRenderContext(context, messageEntry, getSpoilerClickHandler(message)), messagePreprocessor, isWebhook ? DiscordParser.ParserOptions.ALLOW_MASKED_LINKS : DiscordParser.ParserOptions.DEFAULT, z3); simpleDraweeSpanTextView.setAutoLinkMask((messagePreprocessor.isLinkifyConflicting() || !shouldLinkify(message.getContent())) ? 0 : 6); if (parseChannelMessage.length() <= 0) { z2 = false; } if (!z2) { i = 8; } simpleDraweeSpanTextView.setVisibility(i); simpleDraweeSpanTextView.setDraweeSpanStringBuilder(parseChannelMessage); Integer type = messageEntry.getMessage().getType(); simpleDraweeSpanTextView.setAlpha((type != null && type.intValue() == -1) ? 0.5f : 1.0f); } private final boolean shouldLinkify(String str) { if (str == null) { return false; } if (str.length() < 200) { return true; } int length = str.length(); int i = 0; for (int i2 = 0; i2 < length; i2++) { if (str.charAt(i2) == '.' && (i = i + 1) >= 50) { return false; } } return true; } private final boolean shouldShowInteractionMessage(Message message) { return message.isLocalApplicationCommand() || message.isLoading(); } @Override // com.discord.widgets.chat.list.adapter.WidgetChatListItem public void onConfigure(int i, ChatListEntry chatListEntry) { TextView textView; View view; m.checkNotNullParameter(chatListEntry, "data"); super.onConfigure(i, chatListEntry); MessageEntry messageEntry = (MessageEntry) chatListEntry; long j = 0; if (((WidgetChatListAdapter) this.adapter).getData().getUserId() != 0) { Message message = messageEntry.getMessage(); boolean isThreadStarterMessage = messageEntry.isThreadStarterMessage(); configureItemTag(message); View view2 = this.backgroundHighlight; if (!(view2 == null || (view = this.gutterHighlight) == null)) { configureCellHighlight(message, view2, view); } TextView textView2 = this.itemName; if (textView2 != null) { Map nickOrUsernames = messageEntry.getNickOrUsernames(); User author = message.getAuthor(); textView2.setText(nickOrUsernames.get(author != null ? Long.valueOf(author.i()) : null)); this.itemName.setTextColor(getAuthorTextColor(messageEntry.getAuthor())); this.itemName.setOnClickListener(new WidgetChatListAdapterItemMessage$onConfigure$1(this, message)); ViewExtensions.setOnLongClickListenerConsumeClick(this.itemName, new WidgetChatListAdapterItemMessage$onConfigure$2(this, message)); } TextView textView3 = this.itemTimestamp; if (textView3 != null) { Context x2 = a.x(this.itemView, "itemView", "itemView.context"); UtcDateTime timestamp = message.getTimestamp(); if (timestamp != null) { j = timestamp.f(); } textView3.setText(TimeUtils.toReadableTimeString$default(x2, j, null, 4, null)); } configureInteractionMessage(messageEntry); if (!shouldShowInteractionMessage(message) || (textView = this.itemLoadingText) == null) { processMessageText(this.itemText, messageEntry); textView = this.itemText; } ViewCompat.setAccessibilityDelegate(this.itemView, new ChatListItemMessageAccessibilityDelegate(textView, this.itemName, this.itemTag, this.itemTimestamp)); View view3 = this.threadStarterMessageHeader; if (view3 != null) { ViewKt.setVisible(view3, isThreadStarterMessage); } this.itemView.setOnClickListener(new WidgetChatListAdapterItemMessage$onConfigure$3(this, message, isThreadStarterMessage)); View view4 = this.itemView; m.checkNotNullExpressionValue(view4, "itemView"); ViewExtensions.setOnLongClickListenerConsumeClick(view4, new WidgetChatListAdapterItemMessage$onConfigure$4(this, message, isThreadStarterMessage)); configureReplyPreview(messageEntry); ImageView imageView = this.itemAvatar; if (imageView != null) { imageView.setOnClickListener(new WidgetChatListAdapterItemMessage$onConfigure$5(this, message)); ViewExtensions.setOnLongClickListenerConsumeClick(this.itemAvatar, new WidgetChatListAdapterItemMessage$onConfigure$6(this, message)); ImageView imageView2 = this.itemAvatar; User author2 = message.getAuthor(); m.checkNotNull(author2); IconUtils.setIcon$default(imageView2, new CoreUser(author2), 2131165285, null, null, messageEntry.getAuthor(), 24, null); } boolean z2 = true; if (this.failedUploadList != null) { List localAttachments = message.getLocalAttachments(); if (!message.isFailed() || localAttachments == null || !(!localAttachments.isEmpty())) { this.failedUploadList.setVisibility(8); } else { this.failedUploadList.setVisibility(0); this.failedUploadList.setUp(localAttachments); } } if (this.itemAlertText != null) { if (message.isFailed()) { this.itemAlertText.setVisibility(0); Integer type = message.getType(); if (type == null || type.intValue() != -3) { z2 = false; } this.itemAlertText.setText(z2 ? 2131890614 : 2131893336); } else { this.itemAlertText.setVisibility(8); } } configureThreadSpine(message, isThreadStarterMessage); } } }