2021-08-09 22:50:52 +00:00
|
|
|
package com.discord.widgets.chat.overlay;
|
|
|
|
|
2021-10-18 07:12:10 +00:00
|
|
|
import c0.z.d.m;
|
2021-08-09 22:50:52 +00:00
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.api.guild.GuildVerificationLevel;
|
|
|
|
import com.discord.stores.StoreSlowMode;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.guilds.GuildVerificationLevelUtils;
|
|
|
|
import com.discord.widgets.chat.overlay.ChatTypingModel;
|
2021-10-18 07:12:10 +00:00
|
|
|
import i0.k.b;
|
|
|
|
import i0.l.e.j;
|
2021-08-09 22:50:52 +00:00
|
|
|
import java.util.List;
|
|
|
|
import rx.Observable;
|
|
|
|
import rx.functions.Func2;
|
|
|
|
/* compiled from: ChatTypingModel.kt */
|
|
|
|
public final class ChatTypingModel$Companion$getTypingObservableForChannel$2<T, R> implements b<Channel, Observable<? extends ChatTypingModel>> {
|
|
|
|
public static final ChatTypingModel$Companion$getTypingObservableForChannel$2 INSTANCE = new ChatTypingModel$Companion$getTypingObservableForChannel$2();
|
|
|
|
|
|
|
|
/* compiled from: ChatTypingModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.chat.overlay.ChatTypingModel$Companion$getTypingObservableForChannel$2$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1<T, R> implements b<GuildVerificationLevel, Observable<? extends ChatTypingModel>> {
|
|
|
|
public final /* synthetic */ Channel $channel;
|
|
|
|
|
|
|
|
/* compiled from: ChatTypingModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.chat.overlay.ChatTypingModel$Companion$getTypingObservableForChannel$2$1$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1<T1, T2, R> implements Func2<List<? extends CharSequence>, Integer, ChatTypingModel.Typing> {
|
|
|
|
public final /* synthetic */ AnonymousClass1 this$0;
|
|
|
|
|
|
|
|
public AnonymousClass1(AnonymousClass1 r1) {
|
|
|
|
this.this$0 = r1;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final ChatTypingModel.Typing call(List<? extends CharSequence> list, Integer num) {
|
|
|
|
m.checkNotNullExpressionValue(list, "typingUsers");
|
|
|
|
int u = this.this$0.$channel.u();
|
|
|
|
m.checkNotNullExpressionValue(num, "cooldownSecs");
|
|
|
|
return new ChatTypingModel.Typing(list, u, num.intValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public AnonymousClass1(Channel channel) {
|
|
|
|
this.$channel = channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Observable<? extends ChatTypingModel> call(GuildVerificationLevel guildVerificationLevel) {
|
|
|
|
return guildVerificationLevel.compareTo(GuildVerificationLevel.NONE) > 0 ? new j(ChatTypingModel.Hide.INSTANCE) : Observable.j(ChatTypingModel.Companion.access$getTypingUsers(ChatTypingModel.Companion, this.$channel), StoreStream.Companion.getSlowMode().observeCooldownSecs(Long.valueOf(this.$channel.h()), StoreSlowMode.Type.MessageSend.INSTANCE), new AnonymousClass1(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Observable<? extends ChatTypingModel> call(Channel channel) {
|
2021-10-22 07:30:30 +00:00
|
|
|
return channel == null ? new j(ChatTypingModel.Hide.INSTANCE) : GuildVerificationLevelUtils.observeVerificationLevelTriggered$default(GuildVerificationLevelUtils.INSTANCE, channel.f(), null, null, null, 14, null).Y(new AnonymousClass1(channel));
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
}
|