2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.status;
|
|
|
|
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.z.d.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.stores.StorePermissions;
|
|
|
|
import com.discord.stores.StoreThreadsActiveJoined;
|
|
|
|
import com.discord.utilities.threads.ThreadUtils;
|
|
|
|
import com.discord.widgets.status.WidgetThreadStatusViewModel;
|
2021-10-15 06:18:26 +00:00
|
|
|
import i0.k.b;
|
2021-08-03 07:33:18 +00:00
|
|
|
import java.util.Map;
|
|
|
|
import rx.Observable;
|
2021-08-28 06:29:07 +00:00
|
|
|
import rx.functions.Func2;
|
2021-08-03 07:33:18 +00:00
|
|
|
/* compiled from: WidgetThreadStatusViewModel.kt */
|
|
|
|
public final class WidgetThreadStatusViewModel$Companion$observeStoreState$1<T, R> implements b<Channel, Observable<? extends WidgetThreadStatusViewModel.StoreState>> {
|
|
|
|
public final /* synthetic */ StorePermissions $storePermissions;
|
|
|
|
public final /* synthetic */ StoreThreadsActiveJoined $storeThreadsActiveJoined;
|
|
|
|
|
|
|
|
/* compiled from: WidgetThreadStatusViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.status.WidgetThreadStatusViewModel$Companion$observeStoreState$1$1 reason: invalid class name */
|
2021-08-28 06:29:07 +00:00
|
|
|
public static final class AnonymousClass1<T1, T2, R> implements Func2<Map<Long, ? extends Map<Long, ? extends StoreThreadsActiveJoined.ActiveJoinedThread>>, Long, WidgetThreadStatusViewModel.StoreState> {
|
2021-08-03 07:33:18 +00:00
|
|
|
public final /* synthetic */ Channel $selectedChannel;
|
|
|
|
|
|
|
|
public AnonymousClass1(Channel channel) {
|
|
|
|
this.$selectedChannel = channel;
|
|
|
|
}
|
|
|
|
|
2021-08-28 06:29:07 +00:00
|
|
|
public final WidgetThreadStatusViewModel.StoreState call(Map<Long, ? extends Map<Long, StoreThreadsActiveJoined.ActiveJoinedThread>> map, Long l) {
|
2021-08-03 07:33:18 +00:00
|
|
|
ThreadUtils threadUtils = ThreadUtils.INSTANCE;
|
|
|
|
Channel channel = this.$selectedChannel;
|
|
|
|
m.checkNotNullExpressionValue(channel, "selectedChannel");
|
|
|
|
boolean canUnarchiveThread = threadUtils.canUnarchiveThread(channel, l);
|
|
|
|
boolean isThreadModerator = threadUtils.isThreadModerator(Long.valueOf(l != null ? l.longValue() : 0));
|
|
|
|
m.checkNotNullExpressionValue(map, "activeJoinedThreads");
|
2021-08-28 06:29:07 +00:00
|
|
|
return new WidgetThreadStatusViewModel.StoreState(map, this.$selectedChannel, canUnarchiveThread, isThreadModerator);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
2021-08-28 06:29:07 +00:00
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
|
|
|
|
@Override // rx.functions.Func2
|
|
|
|
public /* bridge */ /* synthetic */ WidgetThreadStatusViewModel.StoreState call(Map<Long, ? extends Map<Long, ? extends StoreThreadsActiveJoined.ActiveJoinedThread>> map, Long l) {
|
|
|
|
return call((Map<Long, ? extends Map<Long, StoreThreadsActiveJoined.ActiveJoinedThread>>) map, l);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-28 06:29:07 +00:00
|
|
|
public WidgetThreadStatusViewModel$Companion$observeStoreState$1(StoreThreadsActiveJoined storeThreadsActiveJoined, StorePermissions storePermissions) {
|
2021-08-03 07:33:18 +00:00
|
|
|
this.$storeThreadsActiveJoined = storeThreadsActiveJoined;
|
|
|
|
this.$storePermissions = storePermissions;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Observable<? extends WidgetThreadStatusViewModel.StoreState> call(Channel channel) {
|
2021-10-15 06:18:26 +00:00
|
|
|
return Observable.j(this.$storeThreadsActiveJoined.observeActiveJoinedThreadsForGuild(channel.f()), this.$storePermissions.observePermissionsForChannel(channel.h()), new AnonymousClass1(channel)).q();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|