58 lines
3.7 KiB
Java
58 lines
3.7 KiB
Java
|
package com.discord.widgets.status;
|
||
|
|
||
|
import com.discord.api.channel.Channel;
|
||
|
import com.discord.stores.StorePermissions;
|
||
|
import com.discord.stores.StoreThreadsActiveJoined;
|
||
|
import com.discord.stores.StoreThreadsJoined;
|
||
|
import com.discord.utilities.threads.ThreadUtils;
|
||
|
import com.discord.widgets.status.WidgetThreadStatusViewModel;
|
||
|
import d0.z.d.m;
|
||
|
import j0.k.b;
|
||
|
import java.util.Map;
|
||
|
import rx.Observable;
|
||
|
import rx.functions.Func3;
|
||
|
/* 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;
|
||
|
public final /* synthetic */ StoreThreadsJoined $storeThreadsJoined;
|
||
|
|
||
|
/* compiled from: WidgetThreadStatusViewModel.kt */
|
||
|
/* renamed from: com.discord.widgets.status.WidgetThreadStatusViewModel$Companion$observeStoreState$1$1 reason: invalid class name */
|
||
|
public static final class AnonymousClass1<T1, T2, T3, R> implements Func3<Map<Long, ? extends Map<Long, ? extends StoreThreadsActiveJoined.ActiveJoinedThread>>, Long, StoreThreadsJoined.JoinedThread, WidgetThreadStatusViewModel.StoreState> {
|
||
|
public final /* synthetic */ Channel $selectedChannel;
|
||
|
|
||
|
public AnonymousClass1(Channel channel) {
|
||
|
this.$selectedChannel = channel;
|
||
|
}
|
||
|
|
||
|
public final WidgetThreadStatusViewModel.StoreState call(Map<Long, ? extends Map<Long, StoreThreadsActiveJoined.ActiveJoinedThread>> map, Long l, StoreThreadsJoined.JoinedThread joinedThread) {
|
||
|
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));
|
||
|
boolean z2 = joinedThread != null;
|
||
|
m.checkNotNullExpressionValue(map, "activeJoinedThreads");
|
||
|
return new WidgetThreadStatusViewModel.StoreState(map, this.$selectedChannel, canUnarchiveThread, isThreadModerator, z2);
|
||
|
}
|
||
|
|
||
|
/* 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, java.lang.Object, java.lang.Object] */
|
||
|
@Override // rx.functions.Func3
|
||
|
public /* bridge */ /* synthetic */ WidgetThreadStatusViewModel.StoreState call(Map<Long, ? extends Map<Long, ? extends StoreThreadsActiveJoined.ActiveJoinedThread>> map, Long l, StoreThreadsJoined.JoinedThread joinedThread) {
|
||
|
return call((Map<Long, ? extends Map<Long, StoreThreadsActiveJoined.ActiveJoinedThread>>) map, l, joinedThread);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public WidgetThreadStatusViewModel$Companion$observeStoreState$1(StoreThreadsActiveJoined storeThreadsActiveJoined, StorePermissions storePermissions, StoreThreadsJoined storeThreadsJoined) {
|
||
|
this.$storeThreadsActiveJoined = storeThreadsActiveJoined;
|
||
|
this.$storePermissions = storePermissions;
|
||
|
this.$storeThreadsJoined = storeThreadsJoined;
|
||
|
}
|
||
|
|
||
|
public final Observable<? extends WidgetThreadStatusViewModel.StoreState> call(Channel channel) {
|
||
|
return Observable.i(this.$storeThreadsActiveJoined.observeActiveJoinedThreadsForGuild(channel.f()), this.$storePermissions.observePermissionsForChannel(channel.h()), this.$storeThreadsJoined.observeRecentlyAutoUpgradedNotifications(channel.h()), new AnonymousClass1(channel)).r();
|
||
|
}
|
||
|
}
|