168 lines
6.6 KiB
Java
168 lines
6.6 KiB
Java
package com.discord.widgets.chat.overlay;
|
|
|
|
import b.d.b.a.a;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.stores.StoreSlowMode;
|
|
import com.discord.stores.StoreStream;
|
|
import d0.z.d.m;
|
|
import j0.l.a.r;
|
|
import j0.l.a.u0;
|
|
import j0.l.e.k;
|
|
import java.util.List;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import rx.Observable;
|
|
/* compiled from: ChatTypingModel.kt */
|
|
public abstract class ChatTypingModel {
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
/* compiled from: ChatTypingModel.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public static final /* synthetic */ Observable access$getTypingObservableForChannel(Companion companion, Channel channel) {
|
|
return companion.getTypingObservableForChannel(channel);
|
|
}
|
|
|
|
public static final /* synthetic */ Observable access$getTypingObservableForDraft(Companion companion, Channel channel) {
|
|
return companion.getTypingObservableForDraft(channel);
|
|
}
|
|
|
|
public static final /* synthetic */ Observable access$getTypingUsers(Companion companion, Channel channel) {
|
|
return companion.getTypingUsers(channel);
|
|
}
|
|
|
|
private final Observable<ChatTypingModel> getTypingObservableForChannel(Channel channel) {
|
|
k kVar = new k(channel);
|
|
Observable<ChatTypingModel> Y = Observable.h0(new r(kVar.j, new u0(ChatTypingModel$Companion$getTypingObservableForChannel$1.INSTANCE))).Y(ChatTypingModel$Companion$getTypingObservableForChannel$2.INSTANCE);
|
|
m.checkNotNullExpressionValue(Y, "Observable.just(resolved… }\n }");
|
|
return Y;
|
|
}
|
|
|
|
private final Observable<ChatTypingModel> getTypingObservableForDraft(Channel channel) {
|
|
Observable<R> Y = StoreStream.Companion.getSlowMode().observeCooldownSecs(Long.valueOf(channel.h()), StoreSlowMode.Type.ThreadCreate.INSTANCE).Y(new ChatTypingModel$Companion$getTypingObservableForDraft$1(channel));
|
|
m.checkNotNullExpressionValue(Y, "StoreStream\n …ldownSecs))\n }");
|
|
return Y;
|
|
}
|
|
|
|
private final Observable<List<CharSequence>> getTypingUsers(Channel channel) {
|
|
Observable<List<CharSequence>> q = StoreStream.Companion.getUsersTyping().observeTypingUsers(channel.h()).Y(new ChatTypingModel$Companion$getTypingUsers$1(channel)).F(ChatTypingModel$Companion$getTypingUsers$2.INSTANCE).q();
|
|
m.checkNotNullExpressionValue(q, "StoreStream\n .g… .distinctUntilChanged()");
|
|
return q;
|
|
}
|
|
|
|
public final Observable<ChatTypingModel> get() {
|
|
Observable<ChatTypingModel> q = StoreStream.Companion.getChannelsSelected().observeResolvedSelectedChannel().Y(ChatTypingModel$Companion$get$1.INSTANCE).q();
|
|
m.checkNotNullExpressionValue(q, "StoreStream.getChannelsS… .distinctUntilChanged()");
|
|
return q;
|
|
}
|
|
}
|
|
|
|
/* compiled from: ChatTypingModel.kt */
|
|
public static final class Hide extends ChatTypingModel {
|
|
public static final Hide INSTANCE = new Hide();
|
|
|
|
private Hide() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
/* compiled from: ChatTypingModel.kt */
|
|
public static final class Typing extends ChatTypingModel {
|
|
private final int channelRateLimit;
|
|
private final int cooldownSecs;
|
|
private final List<CharSequence> typingUsers;
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r2v0, resolved type: java.util.List<? extends java.lang.CharSequence> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public Typing(List<? extends CharSequence> list, int i, int i2) {
|
|
super(null);
|
|
m.checkNotNullParameter(list, "typingUsers");
|
|
this.typingUsers = list;
|
|
this.channelRateLimit = i;
|
|
this.cooldownSecs = i2;
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.chat.overlay.ChatTypingModel$Typing */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ Typing copy$default(Typing typing, List list, int i, int i2, int i3, Object obj) {
|
|
if ((i3 & 1) != 0) {
|
|
list = typing.typingUsers;
|
|
}
|
|
if ((i3 & 2) != 0) {
|
|
i = typing.channelRateLimit;
|
|
}
|
|
if ((i3 & 4) != 0) {
|
|
i2 = typing.cooldownSecs;
|
|
}
|
|
return typing.copy(list, i, i2);
|
|
}
|
|
|
|
public final List<CharSequence> component1() {
|
|
return this.typingUsers;
|
|
}
|
|
|
|
public final int component2() {
|
|
return this.channelRateLimit;
|
|
}
|
|
|
|
public final int component3() {
|
|
return this.cooldownSecs;
|
|
}
|
|
|
|
public final Typing copy(List<? extends CharSequence> list, int i, int i2) {
|
|
m.checkNotNullParameter(list, "typingUsers");
|
|
return new Typing(list, i, i2);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof Typing)) {
|
|
return false;
|
|
}
|
|
Typing typing = (Typing) obj;
|
|
return m.areEqual(this.typingUsers, typing.typingUsers) && this.channelRateLimit == typing.channelRateLimit && this.cooldownSecs == typing.cooldownSecs;
|
|
}
|
|
|
|
public final int getChannelRateLimit() {
|
|
return this.channelRateLimit;
|
|
}
|
|
|
|
public final int getCooldownSecs() {
|
|
return this.cooldownSecs;
|
|
}
|
|
|
|
public final List<CharSequence> getTypingUsers() {
|
|
return this.typingUsers;
|
|
}
|
|
|
|
public int hashCode() {
|
|
List<CharSequence> list = this.typingUsers;
|
|
return ((((list != null ? list.hashCode() : 0) * 31) + this.channelRateLimit) * 31) + this.cooldownSecs;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("Typing(typingUsers=");
|
|
R.append(this.typingUsers);
|
|
R.append(", channelRateLimit=");
|
|
R.append(this.channelRateLimit);
|
|
R.append(", cooldownSecs=");
|
|
return a.A(R, this.cooldownSecs, ")");
|
|
}
|
|
}
|
|
|
|
private ChatTypingModel() {
|
|
}
|
|
|
|
public /* synthetic */ ChatTypingModel(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|