2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.widgets.chat.list.actions;
|
|
|
|
|
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.api.user.User;
|
|
|
|
import com.discord.models.domain.emoji.EmojiSet;
|
|
|
|
import com.discord.models.guild.Guild;
|
|
|
|
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.StoreEmoji;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.stores.StoreUser;
|
|
|
|
import com.discord.widgets.chat.list.actions.WidgetChatListActions;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import j0.k.b;
|
|
|
|
import j0.l.e.j;
|
|
|
|
import java.util.Map;
|
|
|
|
import kotlin.Pair;
|
|
|
|
import rx.Observable;
|
|
|
|
import rx.functions.Func5;
|
|
|
|
/* compiled from: WidgetChatListActions.kt */
|
2021-06-27 20:53:42 +00:00
|
|
|
public final class WidgetChatListActions$Model$Companion$get$2<T, R> implements b<Pair<? extends Message, ? extends Channel>, Observable<? extends WidgetChatListActions.Model>> {
|
2021-06-27 20:44:35 +00:00
|
|
|
public final /* synthetic */ long $channelId;
|
|
|
|
public final /* synthetic */ CharSequence $messageContent;
|
|
|
|
public final /* synthetic */ int $type;
|
|
|
|
|
|
|
|
/* compiled from: WidgetChatListActions.kt */
|
|
|
|
/* renamed from: com.discord.widgets.chat.list.actions.WidgetChatListActions$Model$Companion$get$2$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1<T, R> implements b<Map<Long, ? extends GuildMember>, GuildMember> {
|
|
|
|
public final /* synthetic */ long $authorId;
|
|
|
|
|
|
|
|
public AnonymousClass1(long j) {
|
|
|
|
this.$authorId = j;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildMember call(Map<Long, GuildMember> map) {
|
|
|
|
return map.get(Long.valueOf(this.$authorId));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
|
|
@Override // j0.k.b
|
|
|
|
public /* bridge */ /* synthetic */ GuildMember call(Map<Long, ? extends GuildMember> map) {
|
|
|
|
return call((Map<Long, GuildMember>) map);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetChatListActions.kt */
|
|
|
|
/* renamed from: com.discord.widgets.chat.list.actions.WidgetChatListActions$Model$Companion$get$2$2 reason: invalid class name */
|
2021-07-03 23:36:06 +00:00
|
|
|
public static final class AnonymousClass2<T1, T2, T3, T4, T5, R> implements Func5<Long, MeUser, GuildMember, Guild, EmojiSet, WidgetChatListActions.Model> {
|
2021-06-27 20:44:35 +00:00
|
|
|
public final /* synthetic */ Channel $channel;
|
2021-06-27 20:53:42 +00:00
|
|
|
public final /* synthetic */ Message $message;
|
2021-06-27 20:44:35 +00:00
|
|
|
public final /* synthetic */ WidgetChatListActions$Model$Companion$get$2 this$0;
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
public AnonymousClass2(WidgetChatListActions$Model$Companion$get$2 widgetChatListActions$Model$Companion$get$2, Message message, Channel channel) {
|
2021-06-27 20:44:35 +00:00
|
|
|
this.this$0 = widgetChatListActions$Model$Companion$get$2;
|
2021-06-27 20:53:42 +00:00
|
|
|
this.$message = message;
|
2021-06-27 20:44:35 +00:00
|
|
|
this.$channel = channel;
|
|
|
|
}
|
|
|
|
|
2021-07-03 23:36:06 +00:00
|
|
|
public final WidgetChatListActions.Model call(Long l, MeUser meUser, GuildMember guildMember, Guild guild, EmojiSet emojiSet) {
|
2021-06-27 20:44:35 +00:00
|
|
|
WidgetChatListActions.Model.Companion companion = WidgetChatListActions.Model.Companion;
|
2021-06-27 20:53:42 +00:00
|
|
|
Message message = this.$message;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(meUser, "meUser");
|
|
|
|
Channel channel = this.$channel;
|
|
|
|
WidgetChatListActions$Model$Companion$get$2 widgetChatListActions$Model$Companion$get$2 = this.this$0;
|
|
|
|
CharSequence charSequence = widgetChatListActions$Model$Companion$get$2.$messageContent;
|
|
|
|
int i = widgetChatListActions$Model$Companion$get$2.$type;
|
|
|
|
m.checkNotNullExpressionValue(emojiSet, "emojis");
|
2021-07-03 23:36:06 +00:00
|
|
|
return WidgetChatListActions.Model.Companion.access$create(companion, message, guild, l, meUser, guildMember, channel, charSequence, i, emojiSet);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetChatListActions$Model$Companion$get$2(long j, CharSequence charSequence, int i) {
|
|
|
|
this.$channelId = j;
|
|
|
|
this.$messageContent = charSequence;
|
|
|
|
this.$type = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
|
|
@Override // j0.k.b
|
2021-06-27 20:53:42 +00:00
|
|
|
public /* bridge */ /* synthetic */ Observable<? extends WidgetChatListActions.Model> call(Pair<? extends Message, ? extends Channel> pair) {
|
|
|
|
return call((Pair<Message, Channel>) pair);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-06-27 20:53:42 +00:00
|
|
|
public final Observable<? extends WidgetChatListActions.Model> call(Pair<Message, Channel> pair) {
|
2021-07-03 23:36:06 +00:00
|
|
|
User author;
|
2021-06-27 20:53:42 +00:00
|
|
|
Message component1 = pair.component1();
|
2021-06-27 20:44:35 +00:00
|
|
|
Channel component2 = pair.component2();
|
2021-07-03 23:36:06 +00:00
|
|
|
long i = (component1 == null || (author = component1.getAuthor()) == null) ? 0 : author.i();
|
2021-06-27 20:44:35 +00:00
|
|
|
if (component2 == null) {
|
|
|
|
return new j(null);
|
|
|
|
}
|
|
|
|
StoreStream.Companion companion = StoreStream.Companion;
|
2021-07-03 23:36:06 +00:00
|
|
|
return Observable.g(companion.getPermissions().observePermissionsForChannel(this.$channelId), StoreUser.observeMe$default(companion.getUsers(), false, 1, null), companion.getGuilds().observeComputed(component2.f(), d0.t.m.listOf(Long.valueOf(i))).F(new AnonymousClass1(i)), companion.getGuilds().observeGuild(component2.f()).r(), StoreEmoji.getEmojiSet$default(companion.getEmojis(), component2.f(), component2.h(), false, false, 12, null), new AnonymousClass2(this, component1, component2));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|