46 lines
2.8 KiB
Java
46 lines
2.8 KiB
Java
|
package com.discord.widgets.servers;
|
||
|
|
||
|
import com.discord.api.role.GuildRole;
|
||
|
import com.discord.models.domain.ModelGuildIntegration;
|
||
|
import com.discord.models.guild.Guild;
|
||
|
import com.discord.models.user.MeUser;
|
||
|
import com.discord.utilities.permissions.PermissionUtils;
|
||
|
import com.discord.widgets.servers.WidgetServerSettingsIntegrations;
|
||
|
import d0.t.k;
|
||
|
import d0.z.d.m;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Map;
|
||
|
import rx.functions.Func5;
|
||
|
/* compiled from: WidgetServerSettingsIntegrations.kt */
|
||
|
public final class WidgetServerSettingsIntegrations$Model$Companion$get$1<T1, T2, T3, T4, T5, R> implements Func5<Map<Long, ? extends ModelGuildIntegration>, MeUser, Long, Guild, Map<Long, ? extends GuildRole>, WidgetServerSettingsIntegrations.Model> {
|
||
|
public static final WidgetServerSettingsIntegrations$Model$Companion$get$1 INSTANCE = new WidgetServerSettingsIntegrations$Model$Companion$get$1();
|
||
|
|
||
|
public final WidgetServerSettingsIntegrations.Model call(Map<Long, ? extends ModelGuildIntegration> map, MeUser meUser, Long l, Guild guild, Map<Long, GuildRole> map2) {
|
||
|
boolean z2 = false;
|
||
|
if (!(l == null || guild == null || !(guild.isOwner(meUser.getId()) || PermissionUtils.canAndIsElevated(32, l, meUser.getMfaEnabled(), guild.getMfaLevel())))) {
|
||
|
z2 = true;
|
||
|
}
|
||
|
if (!z2 || map == null || map2 == null || guild == null) {
|
||
|
return null;
|
||
|
}
|
||
|
ArrayList arrayList = new ArrayList();
|
||
|
for (Map.Entry<Long, ? extends ModelGuildIntegration> entry : map.entrySet()) {
|
||
|
ModelGuildIntegration modelGuildIntegration = (ModelGuildIntegration) entry.getValue();
|
||
|
String[] strArr = ModelGuildIntegration.SUPPORTED_TYPES;
|
||
|
m.checkNotNullExpressionValue(strArr, "ModelGuildIntegration.SUPPORTED_TYPES");
|
||
|
WidgetServerSettingsIntegrations.Model.IntegrationItem integrationItem = k.contains(strArr, modelGuildIntegration.getType()) ? new WidgetServerSettingsIntegrations.Model.IntegrationItem(modelGuildIntegration, guild.getId()) : null;
|
||
|
if (integrationItem != null) {
|
||
|
arrayList.add(integrationItem);
|
||
|
}
|
||
|
}
|
||
|
return new WidgetServerSettingsIntegrations.Model(guild.getId(), guild.getName(), arrayList);
|
||
|
}
|
||
|
|
||
|
/* 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] */
|
||
|
@Override // rx.functions.Func5
|
||
|
public /* bridge */ /* synthetic */ WidgetServerSettingsIntegrations.Model call(Map<Long, ? extends ModelGuildIntegration> map, MeUser meUser, Long l, Guild guild, Map<Long, ? extends GuildRole> map2) {
|
||
|
return call(map, meUser, l, guild, (Map<Long, GuildRole>) map2);
|
||
|
}
|
||
|
}
|