81 lines
4.9 KiB
Java
81 lines
4.9 KiB
Java
package com.discord.utilities.channel;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.guild.GuildFeature;
|
|
import com.discord.api.permission.Permission;
|
|
import com.discord.api.role.GuildRole;
|
|
import com.discord.models.domain.ModelNotificationSettings;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.models.user.MeUser;
|
|
import com.discord.utilities.permissions.ManageGuildContext;
|
|
import com.discord.utilities.permissions.PermissionUtils;
|
|
import d0.z.d.m;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import rx.functions.Func8;
|
|
/* compiled from: GuildChannelsInfo.kt */
|
|
public final class GuildChannelsInfo$Companion$get$1<T1, T2, T3, T4, T5, T6, T7, T8, R> implements Func8<MeUser, Guild, ModelNotificationSettings, Boolean, Map<Long, ? extends GuildRole>, Long, Map<Long, ? extends Long>, List<? extends Channel>, GuildChannelsInfo> {
|
|
public static final GuildChannelsInfo$Companion$get$1 INSTANCE = new GuildChannelsInfo$Companion$get$1();
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:24:0x0042 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:25:0x0054 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:37:0x0078 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:46:0x009c */
|
|
/* JADX WARNING: Removed duplicated region for block: B:47:0x00a2 */
|
|
public final GuildChannelsInfo call(MeUser meUser, Guild guild, ModelNotificationSettings modelNotificationSettings, Boolean bool, Map<Long, GuildRole> map, Long l, Map<Long, Long> map2, List<Channel> list) {
|
|
boolean z2;
|
|
Set<GuildFeature> features;
|
|
boolean z3 = meUser != null && meUser.getMfaEnabled();
|
|
int mfaLevel = guild != null ? guild.getMfaLevel() : 0;
|
|
boolean isElevated = PermissionUtils.isElevated(16, z3, mfaLevel);
|
|
boolean z4 = isElevated && PermissionUtils.can(16, l);
|
|
Long l2 = null;
|
|
if (!PermissionUtils.can(1, l)) {
|
|
if ((guild != null ? guild.getVanityUrlCode() : null) == null) {
|
|
z2 = false;
|
|
GuildRole guildRole = guild == null ? map.get(Long.valueOf(guild.getId())) : null;
|
|
boolean z5 = isElevated && z4;
|
|
boolean contains = (guild != null || (features = guild.getFeatures()) == null) ? false : features.contains(GuildFeature.VERIFIED);
|
|
ManageGuildContext.Companion companion = ManageGuildContext.Companion;
|
|
m.checkNotNullExpressionValue(list, "categories");
|
|
if (guild != null) {
|
|
l2 = Long.valueOf(guild.getOwnerId());
|
|
}
|
|
boolean z6 = l2 == null && meUser != null && meUser.getId() == guild.getOwnerId();
|
|
m.checkNotNullExpressionValue(map2, "channelPermissions");
|
|
ManageGuildContext from = companion.from(list, z6, l, map2, mfaLevel, meUser == null ? meUser.getMfaEnabled() : false);
|
|
boolean can = PermissionUtils.can(Permission.CHANGE_NICKNAME, l);
|
|
m.checkNotNullExpressionValue(modelNotificationSettings, "guildSettings");
|
|
m.checkNotNullExpressionValue(bool, "hideMuted");
|
|
return new GuildChannelsInfo(guild, guildRole, modelNotificationSettings, bool.booleanValue(), map2, z2, z5, contains, from, can);
|
|
}
|
|
}
|
|
z2 = true;
|
|
if (guild == null) {
|
|
}
|
|
if (isElevated) {
|
|
}
|
|
if (guild != null) {
|
|
}
|
|
ManageGuildContext.Companion companion = ManageGuildContext.Companion;
|
|
m.checkNotNullExpressionValue(list, "categories");
|
|
if (guild != null) {
|
|
}
|
|
if (l2 == null) {
|
|
}
|
|
m.checkNotNullExpressionValue(map2, "channelPermissions");
|
|
ManageGuildContext from = companion.from(list, z6, l, map2, mfaLevel, meUser == null ? meUser.getMfaEnabled() : false);
|
|
boolean can = PermissionUtils.can(Permission.CHANGE_NICKNAME, l);
|
|
m.checkNotNullExpressionValue(modelNotificationSettings, "guildSettings");
|
|
m.checkNotNullExpressionValue(bool, "hideMuted");
|
|
return new GuildChannelsInfo(guild, guildRole, modelNotificationSettings, bool.booleanValue(), map2, z2, z5, contains, from, can);
|
|
}
|
|
|
|
/* 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, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */
|
|
@Override // rx.functions.Func8
|
|
public /* bridge */ /* synthetic */ GuildChannelsInfo call(MeUser meUser, Guild guild, ModelNotificationSettings modelNotificationSettings, Boolean bool, Map<Long, ? extends GuildRole> map, Long l, Map<Long, ? extends Long> map2, List<? extends Channel> list) {
|
|
return call(meUser, guild, modelNotificationSettings, bool, (Map<Long, GuildRole>) map, l, (Map<Long, Long>) map2, (List<Channel>) list);
|
|
}
|
|
}
|