2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.widgets.chat.list.actions;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.view.View;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.annotation.MainThread;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import c.d.b.a.a;
|
|
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.api.thread.ThreadMetadata;
|
2021-06-27 20:53:42 +00:00
|
|
|
import com.discord.api.user.User;
|
2021-06-27 20:44:35 +00:00
|
|
|
import com.discord.app.AppBottomSheet;
|
|
|
|
import com.discord.databinding.WidgetChatListActionsBinding;
|
|
|
|
import com.discord.models.domain.emoji.Emoji;
|
|
|
|
import com.discord.models.domain.emoji.EmojiSet;
|
2021-07-03 23:36:06 +00:00
|
|
|
import com.discord.models.guild.Guild;
|
2021-06-27 20:44:35 +00:00
|
|
|
import com.discord.models.member.GuildMember;
|
2021-07-03 23:36:06 +00:00
|
|
|
import com.discord.models.message.Message;
|
2021-06-27 20:44:35 +00:00
|
|
|
import com.discord.models.user.MeUser;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.dimen.DimenUtils;
|
|
|
|
import com.discord.utilities.mg_recycler.MGRecyclerAdapter;
|
|
|
|
import com.discord.utilities.permissions.ManageMessageContext;
|
|
|
|
import com.discord.utilities.permissions.PermissionUtils;
|
|
|
|
import com.discord.utilities.rest.RestAPI;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import com.discord.utilities.threads.ThreadUtils;
|
|
|
|
import com.discord.utilities.view.recycler.PaddedItemDecorator;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
|
|
import com.discord.widgets.notice.WidgetNoticeDialog;
|
|
|
|
import d0.o;
|
|
|
|
import d0.t.g0;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import j0.l.e.j;
|
|
|
|
import java.util.List;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import kotlin.reflect.KProperty;
|
|
|
|
import rx.Observable;
|
|
|
|
/* compiled from: WidgetChatListActions.kt */
|
|
|
|
public final class WidgetChatListActions extends AppBottomSheet {
|
|
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.W(WidgetChatListActions.class, "binding", "getBinding()Lcom/discord/databinding/WidgetChatListActionsBinding;", 0)};
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private static final String INTENT_EXTRA_MESSAGE_CHANNEL_ID = "INTENT_EXTRA_MESSAGE_CHANNEL_ID";
|
|
|
|
private static final String INTENT_EXTRA_MESSAGE_CONTENT = "INTENT_EXTRA_MESSAGE_CONTENT";
|
|
|
|
private static final String INTENT_EXTRA_MESSAGE_ID = "INTENT_EXTRA_MESSAGE_ID";
|
|
|
|
private static final String INTENT_EXTRA_TYPE = "INTENT_EXTRA_TYPE";
|
|
|
|
private static final int TYPE_CHAT = 0;
|
|
|
|
private static final int TYPE_PINS = 1;
|
|
|
|
private WidgetChatListActionsEmojisAdapter adapter;
|
|
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetChatListActions$binding$2.INSTANCE, null, 2, null);
|
|
|
|
private long channelId;
|
|
|
|
private PaddedItemDecorator itemDecorator;
|
|
|
|
private long messageId;
|
|
|
|
|
|
|
|
/* compiled from: WidgetChatListActions.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void showForChat(FragmentManager fragmentManager, long j, long j2, CharSequence charSequence) {
|
|
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
|
|
m.checkNotNullParameter(charSequence, "messageContent");
|
|
|
|
WidgetChatListActions widgetChatListActions = new WidgetChatListActions();
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
bundle.putLong("INTENT_EXTRA_MESSAGE_CHANNEL_ID", j);
|
|
|
|
bundle.putLong("INTENT_EXTRA_MESSAGE_ID", j2);
|
|
|
|
bundle.putCharSequence("INTENT_EXTRA_MESSAGE_CONTENT", charSequence);
|
|
|
|
bundle.putInt("INTENT_EXTRA_TYPE", 0);
|
|
|
|
widgetChatListActions.setArguments(bundle);
|
|
|
|
widgetChatListActions.show(fragmentManager, WidgetChatListActions.class.getName());
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void showForPin(FragmentManager fragmentManager, long j, long j2, CharSequence charSequence) {
|
|
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
|
|
m.checkNotNullParameter(charSequence, "messageContent");
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
bundle.putLong("INTENT_EXTRA_MESSAGE_CHANNEL_ID", j);
|
|
|
|
bundle.putLong("INTENT_EXTRA_MESSAGE_ID", j2);
|
|
|
|
bundle.putCharSequence("INTENT_EXTRA_MESSAGE_CONTENT", charSequence);
|
|
|
|
bundle.putInt("INTENT_EXTRA_TYPE", 1);
|
|
|
|
WidgetChatListActions widgetChatListActions = new WidgetChatListActions();
|
|
|
|
widgetChatListActions.setArguments(bundle);
|
|
|
|
widgetChatListActions.show(fragmentManager, WidgetChatListActions.class.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetChatListActions.kt */
|
|
|
|
public static final class Model {
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private final Channel channel;
|
2021-07-03 23:36:06 +00:00
|
|
|
private final Guild guild;
|
2021-06-27 20:44:35 +00:00
|
|
|
private final boolean isDeveloper;
|
|
|
|
private final ManageMessageContext manageMessageContext;
|
|
|
|
|
|
|
|
/* renamed from: me reason: collision with root package name */
|
2021-07-04 15:26:29 +00:00
|
|
|
private final MeUser f2138me;
|
2021-06-27 20:53:42 +00:00
|
|
|
private final Message message;
|
2021-06-27 20:44:35 +00:00
|
|
|
private final String messageAuthorName;
|
|
|
|
private final CharSequence messageContent;
|
|
|
|
private final Long permissions;
|
|
|
|
private final List<Emoji> recentEmojis;
|
|
|
|
private final int type;
|
|
|
|
|
|
|
|
/* compiled from: WidgetChatListActions.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
public static final /* synthetic */ Model access$create(Companion companion, Message message, Guild guild, Long l, MeUser meUser, GuildMember guildMember, Channel channel, CharSequence charSequence, int i, EmojiSet emojiSet) {
|
|
|
|
return companion.create(message, guild, l, meUser, guildMember, channel, charSequence, i, emojiSet);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
private final Model create(Message message, Guild guild, Long l, MeUser meUser, GuildMember guildMember, Channel channel, CharSequence charSequence, int i, EmojiSet emojiSet) {
|
2021-06-27 20:53:42 +00:00
|
|
|
String nick;
|
2021-07-03 23:36:06 +00:00
|
|
|
ThreadMetadata y2;
|
2021-06-27 20:53:42 +00:00
|
|
|
String str = null;
|
|
|
|
if (message == null) {
|
2021-06-27 20:44:35 +00:00
|
|
|
return null;
|
|
|
|
}
|
2021-07-03 23:36:06 +00:00
|
|
|
ManageMessageContext from = ManageMessageContext.Companion.from(message, l, meUser, guild != null ? Integer.valueOf(guild.getMfaLevel()) : null, channel != null && AnimatableValueParser.s1(channel), channel != null && AnimatableValueParser.x1(channel), (channel == null || (y2 = channel.y()) == null || !y2.b()) ? false : true);
|
2021-06-27 20:53:42 +00:00
|
|
|
if (guildMember == null || (nick = guildMember.getNick()) == null) {
|
2021-07-03 23:36:06 +00:00
|
|
|
User author = message.getAuthor();
|
|
|
|
if (author != null) {
|
|
|
|
str = author.r();
|
2021-06-27 20:53:42 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
str = nick;
|
|
|
|
}
|
|
|
|
if (str == null) {
|
|
|
|
str = "";
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
boolean isDeveloperMode = StoreStream.Companion.getUserSettings().getIsDeveloperMode();
|
|
|
|
List<Emoji> list = emojiSet.recentEmojis;
|
|
|
|
m.checkNotNullExpressionValue(list, "emojis.recentEmojis");
|
2021-07-03 23:36:06 +00:00
|
|
|
return new Model(message, guild, str, charSequence, from, i, isDeveloperMode, list, channel, l, meUser);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Observable<Model> get(long j, long j2, CharSequence charSequence, int i) {
|
2021-07-03 23:36:06 +00:00
|
|
|
Observable<Model> Y = Observable.j(i != 0 ? i != 1 ? new j<>(null) : StoreStream.Companion.getPinnedMessages().observePinnedMessage(j, j2) : StoreStream.Companion.getMessages().observeMessagesForChannel(j, j2), StoreStream.Companion.getChannels().observeChannel(j), WidgetChatListActions$Model$Companion$get$1.INSTANCE).Y(new WidgetChatListActions$Model$Companion$get$2(j, charSequence, i));
|
|
|
|
m.checkNotNullExpressionValue(Y, "Observable\n .… }\n }");
|
|
|
|
return Y;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r9v0, resolved type: java.util.List<? extends com.discord.models.domain.emoji.Emoji> */
|
2021-06-27 20:44:35 +00:00
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
2021-07-03 23:36:06 +00:00
|
|
|
public Model(Message message, Guild guild, String str, CharSequence charSequence, ManageMessageContext manageMessageContext, int i, boolean z2, List<? extends Emoji> list, Channel channel, Long l, MeUser meUser) {
|
2021-06-27 20:53:42 +00:00
|
|
|
m.checkNotNullParameter(message, "message");
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullParameter(str, "messageAuthorName");
|
|
|
|
m.checkNotNullParameter(manageMessageContext, "manageMessageContext");
|
|
|
|
m.checkNotNullParameter(list, "recentEmojis");
|
|
|
|
m.checkNotNullParameter(meUser, "me");
|
2021-06-27 20:53:42 +00:00
|
|
|
this.message = message;
|
2021-07-03 23:36:06 +00:00
|
|
|
this.guild = guild;
|
2021-06-27 20:44:35 +00:00
|
|
|
this.messageAuthorName = str;
|
|
|
|
this.messageContent = charSequence;
|
|
|
|
this.manageMessageContext = manageMessageContext;
|
|
|
|
this.type = i;
|
|
|
|
this.isDeveloper = z2;
|
|
|
|
this.recentEmojis = list;
|
|
|
|
this.channel = channel;
|
|
|
|
this.permissions = l;
|
2021-07-04 15:26:29 +00:00
|
|
|
this.f2138me = meUser;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
public static /* synthetic */ Model copy$default(Model model, Message message, Guild guild, String str, CharSequence charSequence, ManageMessageContext manageMessageContext, int i, boolean z2, List list, Channel channel, Long l, MeUser meUser, int i2, Object obj) {
|
2021-07-04 15:26:29 +00:00
|
|
|
return model.copy((i2 & 1) != 0 ? model.message : message, (i2 & 2) != 0 ? model.guild : guild, (i2 & 4) != 0 ? model.messageAuthorName : str, (i2 & 8) != 0 ? model.messageContent : charSequence, (i2 & 16) != 0 ? model.manageMessageContext : manageMessageContext, (i2 & 32) != 0 ? model.type : i, (i2 & 64) != 0 ? model.isDeveloper : z2, (i2 & 128) != 0 ? model.recentEmojis : list, (i2 & 256) != 0 ? model.channel : channel, (i2 & 512) != 0 ? model.permissions : l, (i2 & 1024) != 0 ? model.f2138me : meUser);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
public final Message component1() {
|
2021-06-27 20:44:35 +00:00
|
|
|
return this.message;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Long component10() {
|
|
|
|
return this.permissions;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final MeUser component11() {
|
2021-07-04 15:26:29 +00:00
|
|
|
return this.f2138me;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
public final Guild component2() {
|
|
|
|
return this.guild;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final String component3() {
|
|
|
|
return this.messageAuthorName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final CharSequence component4() {
|
|
|
|
return this.messageContent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final ManageMessageContext component5() {
|
|
|
|
return this.manageMessageContext;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final int component6() {
|
|
|
|
return this.type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component7() {
|
|
|
|
return this.isDeveloper;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final List<Emoji> component8() {
|
|
|
|
return this.recentEmojis;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Channel component9() {
|
|
|
|
return this.channel;
|
|
|
|
}
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
public final Model copy(Message message, Guild guild, String str, CharSequence charSequence, ManageMessageContext manageMessageContext, int i, boolean z2, List<? extends Emoji> list, Channel channel, Long l, MeUser meUser) {
|
2021-06-27 20:53:42 +00:00
|
|
|
m.checkNotNullParameter(message, "message");
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullParameter(str, "messageAuthorName");
|
|
|
|
m.checkNotNullParameter(manageMessageContext, "manageMessageContext");
|
|
|
|
m.checkNotNullParameter(list, "recentEmojis");
|
|
|
|
m.checkNotNullParameter(meUser, "me");
|
2021-07-03 23:36:06 +00:00
|
|
|
return new Model(message, guild, str, charSequence, manageMessageContext, i, z2, list, channel, l, meUser);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof Model)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
Model model = (Model) obj;
|
2021-07-04 15:26:29 +00:00
|
|
|
return m.areEqual(this.message, model.message) && m.areEqual(this.guild, model.guild) && m.areEqual(this.messageAuthorName, model.messageAuthorName) && m.areEqual(this.messageContent, model.messageContent) && m.areEqual(this.manageMessageContext, model.manageMessageContext) && this.type == model.type && this.isDeveloper == model.isDeveloper && m.areEqual(this.recentEmojis, model.recentEmojis) && m.areEqual(this.channel, model.channel) && m.areEqual(this.permissions, model.permissions) && m.areEqual(this.f2138me, model.f2138me);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Channel getChannel() {
|
|
|
|
return this.channel;
|
|
|
|
}
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
public final Guild getGuild() {
|
|
|
|
return this.guild;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final ManageMessageContext getManageMessageContext() {
|
|
|
|
return this.manageMessageContext;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final MeUser getMe() {
|
2021-07-04 15:26:29 +00:00
|
|
|
return this.f2138me;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
public final Message getMessage() {
|
2021-06-27 20:44:35 +00:00
|
|
|
return this.message;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String getMessageAuthorName() {
|
|
|
|
return this.messageAuthorName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final CharSequence getMessageContent() {
|
|
|
|
return this.messageContent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Long getPermissions() {
|
|
|
|
return this.permissions;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final List<Emoji> getRecentEmojis() {
|
|
|
|
return this.recentEmojis;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final int getType() {
|
|
|
|
return this.type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
2021-06-27 20:53:42 +00:00
|
|
|
Message message = this.message;
|
2021-06-27 20:44:35 +00:00
|
|
|
int i = 0;
|
2021-07-03 23:36:06 +00:00
|
|
|
int hashCode = (message != null ? message.hashCode() : 0) * 31;
|
|
|
|
Guild guild = this.guild;
|
|
|
|
int hashCode2 = (hashCode + (guild != null ? guild.hashCode() : 0)) * 31;
|
2021-06-27 20:44:35 +00:00
|
|
|
String str = this.messageAuthorName;
|
2021-07-03 23:36:06 +00:00
|
|
|
int hashCode3 = (hashCode2 + (str != null ? str.hashCode() : 0)) * 31;
|
2021-06-27 20:44:35 +00:00
|
|
|
CharSequence charSequence = this.messageContent;
|
2021-07-03 23:36:06 +00:00
|
|
|
int hashCode4 = (hashCode3 + (charSequence != null ? charSequence.hashCode() : 0)) * 31;
|
2021-06-27 20:44:35 +00:00
|
|
|
ManageMessageContext manageMessageContext = this.manageMessageContext;
|
2021-07-03 23:36:06 +00:00
|
|
|
int hashCode5 = (((hashCode4 + (manageMessageContext != null ? manageMessageContext.hashCode() : 0)) * 31) + this.type) * 31;
|
2021-06-27 20:44:35 +00:00
|
|
|
boolean z2 = this.isDeveloper;
|
|
|
|
if (z2) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
int i2 = z2 ? 1 : 0;
|
|
|
|
int i3 = z2 ? 1 : 0;
|
|
|
|
int i4 = z2 ? 1 : 0;
|
2021-07-03 23:36:06 +00:00
|
|
|
int i5 = (hashCode5 + i2) * 31;
|
2021-06-27 20:44:35 +00:00
|
|
|
List<Emoji> list = this.recentEmojis;
|
2021-07-03 23:36:06 +00:00
|
|
|
int hashCode6 = (i5 + (list != null ? list.hashCode() : 0)) * 31;
|
2021-06-27 20:44:35 +00:00
|
|
|
Channel channel = this.channel;
|
2021-07-03 23:36:06 +00:00
|
|
|
int hashCode7 = (hashCode6 + (channel != null ? channel.hashCode() : 0)) * 31;
|
2021-06-27 20:44:35 +00:00
|
|
|
Long l = this.permissions;
|
2021-07-03 23:36:06 +00:00
|
|
|
int hashCode8 = (hashCode7 + (l != null ? l.hashCode() : 0)) * 31;
|
2021-07-04 15:26:29 +00:00
|
|
|
MeUser meUser = this.f2138me;
|
2021-06-27 20:44:35 +00:00
|
|
|
if (meUser != null) {
|
|
|
|
i = meUser.hashCode();
|
|
|
|
}
|
2021-07-03 23:36:06 +00:00
|
|
|
return hashCode8 + i;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isDeveloper() {
|
|
|
|
return this.isDeveloper;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
StringBuilder L = a.L("Model(message=");
|
|
|
|
L.append(this.message);
|
2021-07-03 23:36:06 +00:00
|
|
|
L.append(", guild=");
|
|
|
|
L.append(this.guild);
|
2021-06-27 20:44:35 +00:00
|
|
|
L.append(", messageAuthorName=");
|
|
|
|
L.append(this.messageAuthorName);
|
|
|
|
L.append(", messageContent=");
|
|
|
|
L.append(this.messageContent);
|
|
|
|
L.append(", manageMessageContext=");
|
|
|
|
L.append(this.manageMessageContext);
|
|
|
|
L.append(", type=");
|
|
|
|
L.append(this.type);
|
|
|
|
L.append(", isDeveloper=");
|
|
|
|
L.append(this.isDeveloper);
|
|
|
|
L.append(", recentEmojis=");
|
|
|
|
L.append(this.recentEmojis);
|
|
|
|
L.append(", channel=");
|
|
|
|
L.append(this.channel);
|
|
|
|
L.append(", permissions=");
|
|
|
|
L.append(this.permissions);
|
|
|
|
L.append(", me=");
|
2021-07-04 15:26:29 +00:00
|
|
|
L.append(this.f2138me);
|
2021-06-27 20:44:35 +00:00
|
|
|
L.append(")");
|
|
|
|
return L.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetChatListActions() {
|
|
|
|
super(false, 1, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$addReaction(WidgetChatListActions widgetChatListActions, Emoji emoji) {
|
|
|
|
widgetChatListActions.addReaction(emoji);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$configureUI(WidgetChatListActions widgetChatListActions, Model model) {
|
|
|
|
widgetChatListActions.configureUI(model);
|
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
public static final /* synthetic */ void access$confirmPublishMessage(WidgetChatListActions widgetChatListActions, Message message) {
|
|
|
|
widgetChatListActions.confirmPublishMessage(message);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
public static final /* synthetic */ void access$deleteMessage(WidgetChatListActions widgetChatListActions, Message message) {
|
|
|
|
widgetChatListActions.deleteMessage(message);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
public static final /* synthetic */ void access$editMessage(WidgetChatListActions widgetChatListActions, Message message) {
|
|
|
|
widgetChatListActions.editMessage(message);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ long access$getChannelId$p(WidgetChatListActions widgetChatListActions) {
|
|
|
|
return widgetChatListActions.channelId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ long access$getMessageId$p(WidgetChatListActions widgetChatListActions) {
|
|
|
|
return widgetChatListActions.messageId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$removeAllReactions(WidgetChatListActions widgetChatListActions, Model model) {
|
|
|
|
widgetChatListActions.removeAllReactions(model);
|
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
public static final /* synthetic */ void access$replyMessage(WidgetChatListActions widgetChatListActions, Message message, Channel channel) {
|
|
|
|
widgetChatListActions.replyMessage(message, channel);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$setChannelId$p(WidgetChatListActions widgetChatListActions, long j) {
|
|
|
|
widgetChatListActions.channelId = j;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$setMessageId$p(WidgetChatListActions widgetChatListActions, long j) {
|
|
|
|
widgetChatListActions.messageId = j;
|
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
public static final /* synthetic */ void access$toggleMessagePin(WidgetChatListActions widgetChatListActions, Message message) {
|
|
|
|
widgetChatListActions.toggleMessagePin(message);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final void addReaction(Emoji emoji) {
|
|
|
|
RestAPI api = RestAPI.Companion.getApi();
|
|
|
|
long j = this.channelId;
|
|
|
|
long j2 = this.messageId;
|
|
|
|
String reactionKey = emoji.getReactionKey();
|
|
|
|
m.checkNotNullExpressionValue(reactionKey, "emoji.reactionKey");
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(api.addReaction(j, j2, reactionKey), false, 1, null), this, null, 2, null), getContext(), "REST: addReaction", (Function1) null, new WidgetChatListActions$addReaction$1(this, emoji), (Function1) null, (Function0) null, (Function0) null, 116, (Object) null);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void configureAddReactionEmojisList(List<? extends Emoji> list, boolean z2, boolean z3) {
|
|
|
|
if (list.isEmpty() || z2 || !z3) {
|
|
|
|
RecyclerView recyclerView = getBinding().b;
|
|
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.dialogChatActionsAddReactionEmojisList");
|
|
|
|
recyclerView.setVisibility(8);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
RecyclerView recyclerView2 = getBinding().b;
|
|
|
|
m.checkNotNullExpressionValue(recyclerView2, "binding.dialogChatActionsAddReactionEmojisList");
|
|
|
|
recyclerView2.setVisibility(0);
|
|
|
|
RecyclerView recyclerView3 = getBinding().b;
|
|
|
|
m.checkNotNullExpressionValue(recyclerView3, "binding.dialogChatActionsAddReactionEmojisList");
|
|
|
|
int width = recyclerView3.getWidth();
|
|
|
|
RecyclerView recyclerView4 = getBinding().b;
|
|
|
|
m.checkNotNullExpressionValue(recyclerView4, "binding.dialogChatActionsAddReactionEmojisList");
|
|
|
|
int paddingStart = recyclerView4.getPaddingStart();
|
|
|
|
RecyclerView recyclerView5 = getBinding().b;
|
|
|
|
m.checkNotNullExpressionValue(recyclerView5, "binding.dialogChatActionsAddReactionEmojisList");
|
|
|
|
int paddingEnd = recyclerView5.getPaddingEnd() + paddingStart;
|
|
|
|
int dimensionPixelSize = getResources().getDimensionPixelSize(2131165315);
|
|
|
|
int dpToPixels = DimenUtils.dpToPixels(8);
|
|
|
|
int i = width - paddingEnd;
|
|
|
|
int min = Math.min(list.size() + 1, (i + dpToPixels) / (dimensionPixelSize + dpToPixels));
|
|
|
|
int i2 = min - 1;
|
|
|
|
int max = Math.max(i - ((i2 * dpToPixels) + (dimensionPixelSize * min)), 0);
|
|
|
|
PaddedItemDecorator paddedItemDecorator = this.itemDecorator;
|
|
|
|
if (paddedItemDecorator != null) {
|
|
|
|
getBinding().b.removeItemDecoration(paddedItemDecorator);
|
|
|
|
}
|
|
|
|
PaddedItemDecorator paddedItemDecorator2 = new PaddedItemDecorator(0, (max / i2) + dpToPixels, 0, true);
|
|
|
|
getBinding().b.addItemDecoration(paddedItemDecorator2);
|
|
|
|
this.itemDecorator = paddedItemDecorator2;
|
|
|
|
WidgetChatListActionsEmojisAdapter widgetChatListActionsEmojisAdapter = this.adapter;
|
|
|
|
if (widgetChatListActionsEmojisAdapter == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
|
|
|
widgetChatListActionsEmojisAdapter.setData(list, min);
|
|
|
|
}
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:102:0x02a1 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:103:0x02a3 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:106:0x02be */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:107:0x02c2 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:110:0x02eb */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:111:0x02ed */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:131:0x035b */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:132:0x035d */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:135:0x0394 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:81:0x020a */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:82:0x020c */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:90:0x024a */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:91:0x024c */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:98:0x0277 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:99:0x0279 */
|
2021-06-27 20:44:35 +00:00
|
|
|
private final void configureUI(Model model) {
|
|
|
|
Channel channel;
|
2021-07-03 23:36:06 +00:00
|
|
|
Integer type;
|
|
|
|
Guild guild;
|
|
|
|
Long valueOf = (model == null || (guild = model.getGuild()) == null) ? null : Long.valueOf(guild.getId());
|
|
|
|
if (model == null || valueOf == null) {
|
2021-06-27 20:44:35 +00:00
|
|
|
dismiss();
|
|
|
|
return;
|
|
|
|
}
|
2021-07-03 23:36:06 +00:00
|
|
|
boolean isLocal = model.getMessage().isLocal();
|
|
|
|
boolean isCrossposted = model.getMessage().isCrossposted();
|
2021-06-27 20:44:35 +00:00
|
|
|
boolean z2 = true;
|
|
|
|
int i = 0;
|
|
|
|
boolean z3 = model.getManageMessageContext().getCanEdit() || model.getManageMessageContext().getCanManageMessages();
|
|
|
|
configureAddReactionEmojisList(model.getRecentEmojis(), isLocal, model.getManageMessageContext().getCanAddReactions());
|
2021-07-03 23:36:06 +00:00
|
|
|
int type2 = model.getType();
|
|
|
|
if (type2 == 0) {
|
2021-06-27 20:44:35 +00:00
|
|
|
TextView textView = getBinding().f;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.dialogChatActionsEdit");
|
|
|
|
textView.setVisibility(model.getManageMessageContext().getCanEdit() ? 0 : 8);
|
|
|
|
getBinding().f.setOnClickListener(new WidgetChatListActions$configureUI$1(this, model));
|
2021-07-03 23:36:06 +00:00
|
|
|
} else if (type2 == 1) {
|
2021-06-27 20:44:35 +00:00
|
|
|
TextView textView2 = getBinding().f;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.dialogChatActionsEdit");
|
|
|
|
textView2.setVisibility(8);
|
|
|
|
}
|
|
|
|
TextView textView3 = getBinding().k;
|
|
|
|
m.checkNotNullExpressionValue(textView3, "binding.dialogChatActionsPublish");
|
2021-07-03 23:36:06 +00:00
|
|
|
textView3.setVisibility(z3 && (channel = model.getChannel()) != null && channel.A() == 5 && (type = model.getMessage().getType()) != null && type.intValue() == 0 && !isCrossposted ? 0 : 8);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().k.setOnClickListener(new WidgetChatListActions$configureUI$2(this, model));
|
|
|
|
TextView textView4 = getBinding().g;
|
|
|
|
m.checkNotNullExpressionValue(textView4, "binding.dialogChatActionsManageReactions");
|
2021-07-03 23:36:06 +00:00
|
|
|
textView4.setVisibility(model.getMessage().getReactionsMap().isEmpty() ^ true ? 0 : 8);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().g.setOnClickListener(new WidgetChatListActions$configureUI$3(this));
|
|
|
|
TextView textView5 = getBinding().l;
|
|
|
|
m.checkNotNullExpressionValue(textView5, "binding.dialogChatActionsRemoveAllReactions");
|
2021-07-03 23:36:06 +00:00
|
|
|
textView5.setVisibility((model.getMessage().getReactionsMap().isEmpty() ^ true) && model.getManageMessageContext().getCanManageMessages() ? 0 : 8);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().l.setOnClickListener(new WidgetChatListActions$configureUI$4(this, model));
|
|
|
|
TextView textView6 = getBinding().o;
|
|
|
|
m.checkNotNullExpressionValue(textView6, "binding.dialogChatActionsResend");
|
2021-07-03 23:36:06 +00:00
|
|
|
textView6.setVisibility(model.getMessage().canResend() ? 0 : 8);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().o.setOnClickListener(new WidgetChatListActions$configureUI$5(this, model));
|
|
|
|
TextView textView7 = getBinding().h;
|
|
|
|
m.checkNotNullExpressionValue(textView7, "binding.dialogChatActionsMarkUnread");
|
2021-07-03 23:36:06 +00:00
|
|
|
textView7.setVisibility(!model.getMessage().isFailed() && model.getManageMessageContext().getCanMarkUnread() ? 0 : 8);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().h.setOnClickListener(new WidgetChatListActions$configureUI$6(this, model));
|
|
|
|
if (model.getMessageContent() != null) {
|
2021-07-03 23:36:06 +00:00
|
|
|
if ((model.getMessageContent().length() > 0) && !model.getMessage().isLocalApplicationCommand()) {
|
2021-06-27 20:53:42 +00:00
|
|
|
TextView textView8 = getBinding().f1723c;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(textView8, "binding.dialogChatActionsCopy");
|
|
|
|
textView8.setVisibility(0);
|
2021-06-27 20:53:42 +00:00
|
|
|
getBinding().f1723c.setOnClickListener(new WidgetChatListActions$configureUI$7(this, model));
|
2021-06-27 20:44:35 +00:00
|
|
|
TextView textView9 = getBinding().d;
|
|
|
|
m.checkNotNullExpressionValue(textView9, "binding.dialogChatActionsCopyId");
|
|
|
|
textView9.setVisibility(!(!model.isDeveloper() && !isLocal) ? 0 : 8);
|
|
|
|
getBinding().d.setOnClickListener(new WidgetChatListActions$configureUI$8(this, model));
|
|
|
|
TextView textView10 = getBinding().n;
|
|
|
|
m.checkNotNullExpressionValue(textView10, "binding.dialogChatActionsReport");
|
2021-07-03 23:36:06 +00:00
|
|
|
User author = model.getMessage().getAuthor();
|
|
|
|
textView10.setVisibility(!(author != null || (author.i() > model.getMe().getId() ? 1 : (author.i() == model.getMe().getId() ? 0 : -1)) != 0) ? 0 : 8);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().n.setOnClickListener(new WidgetChatListActions$configureUI$9(this, model));
|
|
|
|
TextView textView11 = getBinding().p;
|
|
|
|
m.checkNotNullExpressionValue(textView11, "binding.dialogChatActionsShare");
|
|
|
|
textView11.setVisibility(!(!model.isDeveloper() && !isLocal) ? 0 : 8);
|
2021-07-03 23:36:06 +00:00
|
|
|
getBinding().p.setOnClickListener(new WidgetChatListActions$configureUI$10(this, model, valueOf));
|
2021-06-27 20:44:35 +00:00
|
|
|
TextView textView12 = getBinding().i;
|
|
|
|
m.checkNotNullExpressionValue(textView12, "binding.dialogChatActionsPin");
|
|
|
|
textView12.setVisibility(!model.getManageMessageContext().getCanTogglePinned() ? 0 : 8);
|
2021-07-03 23:36:06 +00:00
|
|
|
getBinding().i.setText(!m.areEqual(model.getMessage().getPinned(), Boolean.TRUE) ? 2131894171 : 2131891955);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().i.setOnClickListener(new WidgetChatListActions$configureUI$11(this, model));
|
|
|
|
TextView textView13 = getBinding().e;
|
|
|
|
m.checkNotNullExpressionValue(textView13, "binding.dialogChatActionsDelete");
|
|
|
|
textView13.setVisibility(!model.getManageMessageContext().getCanDelete() ? 0 : 8);
|
|
|
|
getBinding().e.setOnClickListener(new WidgetChatListActions$configureUI$12(this, model));
|
|
|
|
getBinding().j.setOnClickListener(new WidgetChatListActions$configureUI$13(this, model));
|
2021-07-03 23:36:06 +00:00
|
|
|
boolean z4 = model.getChannel() == null && AnimatableValueParser.s1(model.getChannel()) && !AnimatableValueParser.x1(model.getChannel());
|
|
|
|
if (isLocal || model.getType() != 0 || !model.getMessage().isUserMessage() || (!z4 && !PermissionUtils.can(67584, model.getPermissions()))) {
|
2021-06-27 20:44:35 +00:00
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
TextView textView14 = getBinding().m;
|
|
|
|
m.checkNotNullExpressionValue(textView14, "binding.dialogChatActionsReply");
|
|
|
|
textView14.setVisibility(!z2 ? 0 : 8);
|
|
|
|
getBinding().m.setOnClickListener(new WidgetChatListActions$configureUI$14(this, model));
|
|
|
|
TextView textView15 = getBinding().q;
|
|
|
|
m.checkNotNullExpressionValue(textView15, "binding.dialogChatActionsStartThread");
|
2021-07-03 23:36:06 +00:00
|
|
|
if (!ThreadUtils.INSTANCE.canCreatePublicThread(model.getPermissions(), model.getChannel(), model.getMessage(), model.getGuild())) {
|
2021-06-27 20:44:35 +00:00
|
|
|
i = 8;
|
|
|
|
}
|
|
|
|
textView15.setVisibility(i);
|
2021-07-03 23:36:06 +00:00
|
|
|
getBinding().q.setOnClickListener(new WidgetChatListActions$configureUI$15(this, valueOf, model));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
2021-06-27 20:53:42 +00:00
|
|
|
TextView textView16 = getBinding().f1723c;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(textView16, "binding.dialogChatActionsCopy");
|
|
|
|
textView16.setVisibility(8);
|
|
|
|
TextView textView9 = getBinding().d;
|
|
|
|
m.checkNotNullExpressionValue(textView9, "binding.dialogChatActionsCopyId");
|
|
|
|
textView9.setVisibility(!(!model.isDeveloper() && !isLocal) ? 0 : 8);
|
|
|
|
getBinding().d.setOnClickListener(new WidgetChatListActions$configureUI$8(this, model));
|
|
|
|
TextView textView10 = getBinding().n;
|
|
|
|
m.checkNotNullExpressionValue(textView10, "binding.dialogChatActionsReport");
|
2021-07-03 23:36:06 +00:00
|
|
|
User author = model.getMessage().getAuthor();
|
|
|
|
textView10.setVisibility(!(author != null || (author.i() > model.getMe().getId() ? 1 : (author.i() == model.getMe().getId() ? 0 : -1)) != 0) ? 0 : 8);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().n.setOnClickListener(new WidgetChatListActions$configureUI$9(this, model));
|
|
|
|
TextView textView11 = getBinding().p;
|
|
|
|
m.checkNotNullExpressionValue(textView11, "binding.dialogChatActionsShare");
|
|
|
|
textView11.setVisibility(!(!model.isDeveloper() && !isLocal) ? 0 : 8);
|
2021-07-03 23:36:06 +00:00
|
|
|
getBinding().p.setOnClickListener(new WidgetChatListActions$configureUI$10(this, model, valueOf));
|
2021-06-27 20:44:35 +00:00
|
|
|
TextView textView12 = getBinding().i;
|
|
|
|
m.checkNotNullExpressionValue(textView12, "binding.dialogChatActionsPin");
|
|
|
|
textView12.setVisibility(!model.getManageMessageContext().getCanTogglePinned() ? 0 : 8);
|
2021-07-03 23:36:06 +00:00
|
|
|
getBinding().i.setText(!m.areEqual(model.getMessage().getPinned(), Boolean.TRUE) ? 2131894171 : 2131891955);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().i.setOnClickListener(new WidgetChatListActions$configureUI$11(this, model));
|
|
|
|
TextView textView13 = getBinding().e;
|
|
|
|
m.checkNotNullExpressionValue(textView13, "binding.dialogChatActionsDelete");
|
|
|
|
textView13.setVisibility(!model.getManageMessageContext().getCanDelete() ? 0 : 8);
|
|
|
|
getBinding().e.setOnClickListener(new WidgetChatListActions$configureUI$12(this, model));
|
|
|
|
getBinding().j.setOnClickListener(new WidgetChatListActions$configureUI$13(this, model));
|
|
|
|
if (model.getChannel() == null) {
|
|
|
|
}
|
|
|
|
z2 = false;
|
|
|
|
TextView textView14 = getBinding().m;
|
|
|
|
m.checkNotNullExpressionValue(textView14, "binding.dialogChatActionsReply");
|
|
|
|
textView14.setVisibility(!z2 ? 0 : 8);
|
|
|
|
getBinding().m.setOnClickListener(new WidgetChatListActions$configureUI$14(this, model));
|
|
|
|
TextView textView15 = getBinding().q;
|
|
|
|
m.checkNotNullExpressionValue(textView15, "binding.dialogChatActionsStartThread");
|
2021-07-03 23:36:06 +00:00
|
|
|
if (!ThreadUtils.INSTANCE.canCreatePublicThread(model.getPermissions(), model.getChannel(), model.getMessage(), model.getGuild())) {
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
textView15.setVisibility(i);
|
2021-07-03 23:36:06 +00:00
|
|
|
getBinding().q.setOnClickListener(new WidgetChatListActions$configureUI$15(this, valueOf, model));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@MainThread
|
2021-06-27 20:53:42 +00:00
|
|
|
private final void confirmPublishMessage(Message message) {
|
2021-06-27 20:44:35 +00:00
|
|
|
MessageActionDialogs messageActionDialogs = MessageActionDialogs.INSTANCE;
|
|
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
2021-06-27 20:53:42 +00:00
|
|
|
messageActionDialogs.showPublishMessageConfirmation(parentFragmentManager, message, new WidgetChatListActions$confirmPublishMessage$1(this));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@MainThread
|
2021-06-27 20:53:42 +00:00
|
|
|
private final void deleteMessage(Message message) {
|
2021-06-27 20:44:35 +00:00
|
|
|
MessageActionDialogs messageActionDialogs = MessageActionDialogs.INSTANCE;
|
|
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
|
|
Context requireContext = requireContext();
|
|
|
|
m.checkNotNullExpressionValue(requireContext, "requireContext()");
|
2021-06-27 20:53:42 +00:00
|
|
|
messageActionDialogs.showDeleteMessageConfirmation(parentFragmentManager, requireContext, message, new WidgetChatListActions$deleteMessage$1(this));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
private final void editMessage(Message message) {
|
2021-07-03 23:36:06 +00:00
|
|
|
Observable<R> Y = StoreStream.Companion.getChannels().observeGuildAndPrivateChannels().Y(new WidgetChatListActions$editMessage$1(message));
|
|
|
|
m.checkNotNullExpressionValue(Y, "StoreStream\n .get… }\n }");
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.takeSingleUntilTimeout$default(ObservableExtensionsKt.computationBuffered(Y), 0, false, 3, null), (Context) null, "editMessage", (Function1) null, new WidgetChatListActions$editMessage$2(message), (Function1) null, (Function0) null, (Function0) null, 117, (Object) null);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final WidgetChatListActionsBinding getBinding() {
|
|
|
|
return (WidgetChatListActionsBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
@MainThread
|
|
|
|
private final void removeAllReactions(Model model) {
|
|
|
|
WidgetNoticeDialog.Companion companion = WidgetNoticeDialog.Companion;
|
|
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
2021-07-03 23:36:06 +00:00
|
|
|
String string = getString(2131892642);
|
|
|
|
String string2 = getString(2131892641);
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(string2, "getString(R.string.remov…l_reactions_confirm_body)");
|
2021-07-03 23:36:06 +00:00
|
|
|
WidgetNoticeDialog.Companion.show$default(companion, parentFragmentManager, string, string2, getString(2131894759), getString(2131891493), g0.mapOf(o.to(2131364075, new WidgetChatListActions$removeAllReactions$1(this, model))), null, null, null, null, null, null, 0, null, 16320, null);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
private final void replyMessage(Message message, Channel channel) {
|
2021-06-27 20:44:35 +00:00
|
|
|
StoreStream.Companion companion = StoreStream.Companion;
|
|
|
|
long id2 = companion.getUsers().getMe().getId();
|
2021-07-03 23:36:06 +00:00
|
|
|
boolean s1 = AnimatableValueParser.s1(channel);
|
|
|
|
boolean isWebhook = message.isWebhook();
|
|
|
|
User author = message.getAuthor();
|
2021-06-27 20:44:35 +00:00
|
|
|
boolean z2 = true;
|
2021-07-03 23:36:06 +00:00
|
|
|
boolean z3 = author != null && author.i() == id2;
|
2021-06-27 20:44:35 +00:00
|
|
|
boolean z4 = !isWebhook && !z3;
|
2021-07-03 23:36:06 +00:00
|
|
|
if (s1 || isWebhook || z3) {
|
2021-06-27 20:44:35 +00:00
|
|
|
z2 = false;
|
|
|
|
}
|
2021-06-27 20:53:42 +00:00
|
|
|
companion.getPendingReplies().onCreatePendingReply(channel, message, z4, z2);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final void showForChat(FragmentManager fragmentManager, long j, long j2, CharSequence charSequence) {
|
|
|
|
Companion.showForChat(fragmentManager, j, j2, charSequence);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final void showForPin(FragmentManager fragmentManager, long j, long j2, CharSequence charSequence) {
|
|
|
|
Companion.showForPin(fragmentManager, j, j2, charSequence);
|
|
|
|
}
|
|
|
|
|
|
|
|
@MainThread
|
2021-06-27 20:53:42 +00:00
|
|
|
private final void toggleMessagePin(Message message) {
|
2021-06-27 20:44:35 +00:00
|
|
|
MessageActionDialogs messageActionDialogs = MessageActionDialogs.INSTANCE;
|
|
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
|
|
Context requireContext = requireContext();
|
|
|
|
m.checkNotNullExpressionValue(requireContext, "requireContext()");
|
2021-06-27 20:53:42 +00:00
|
|
|
messageActionDialogs.showPinMessageConfirmation(parentFragmentManager, requireContext, message, this, new WidgetChatListActions$toggleMessagePin$1(this));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppBottomSheet
|
|
|
|
public int getContentViewResId() {
|
2021-07-03 23:36:06 +00:00
|
|
|
return 2131558925;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppBottomSheet, androidx.fragment.app.Fragment
|
|
|
|
public void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
AppBottomSheet.hideKeyboard$default(this, null, 1, null);
|
2021-07-03 23:36:06 +00:00
|
|
|
Observable r = ObservableExtensionsKt.computationLatest(Model.Companion.get(this.channelId, this.messageId, getArgumentsOrDefault().getCharSequence("INTENT_EXTRA_MESSAGE_CONTENT"), getArgumentsOrDefault().getInt("INTENT_EXTRA_TYPE"))).r();
|
|
|
|
m.checkNotNullExpressionValue(r, "Model.get(channelId, mes… .distinctUntilChanged()");
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(r, this, null, 2, null), WidgetChatListActions.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetChatListActions$onResume$1(this), 62, (Object) null);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppBottomSheet, androidx.fragment.app.Fragment
|
|
|
|
public void onViewCreated(View view, Bundle bundle) {
|
|
|
|
m.checkNotNullParameter(view, "view");
|
|
|
|
super.onViewCreated(view, bundle);
|
|
|
|
this.channelId = getArgumentsOrDefault().getLong("INTENT_EXTRA_MESSAGE_CHANNEL_ID");
|
|
|
|
this.messageId = getArgumentsOrDefault().getLong("INTENT_EXTRA_MESSAGE_ID");
|
|
|
|
MGRecyclerAdapter.Companion companion = MGRecyclerAdapter.Companion;
|
|
|
|
RecyclerView recyclerView = getBinding().b;
|
|
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.dialogChatActionsAddReactionEmojisList");
|
|
|
|
WidgetChatListActionsEmojisAdapter widgetChatListActionsEmojisAdapter = (WidgetChatListActionsEmojisAdapter) companion.configure(new WidgetChatListActionsEmojisAdapter(recyclerView));
|
|
|
|
this.adapter = widgetChatListActionsEmojisAdapter;
|
|
|
|
if (widgetChatListActionsEmojisAdapter == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
|
|
|
widgetChatListActionsEmojisAdapter.setOnClickEmoji(new WidgetChatListActions$onViewCreated$1(this));
|
|
|
|
WidgetChatListActionsEmojisAdapter widgetChatListActionsEmojisAdapter2 = this.adapter;
|
|
|
|
if (widgetChatListActionsEmojisAdapter2 == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
|
|
|
widgetChatListActionsEmojisAdapter2.setOnClickMoreEmojis(new WidgetChatListActions$onViewCreated$2(this));
|
|
|
|
RecyclerView recyclerView2 = getBinding().b;
|
|
|
|
m.checkNotNullExpressionValue(recyclerView2, "binding.dialogChatActionsAddReactionEmojisList");
|
|
|
|
WidgetChatListActionsEmojisAdapter widgetChatListActionsEmojisAdapter3 = this.adapter;
|
|
|
|
if (widgetChatListActionsEmojisAdapter3 == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
|
|
|
recyclerView2.setAdapter(widgetChatListActionsEmojisAdapter3);
|
|
|
|
getBinding().b.setHasFixedSize(true);
|
|
|
|
}
|
|
|
|
}
|