40 lines
2.4 KiB
Java
40 lines
2.4 KiB
Java
package com.discord.widgets.channels;
|
|
|
|
import com.discord.api.guild.GuildFeature;
|
|
import com.discord.api.role.GuildRole;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.models.user.MeUser;
|
|
import com.discord.utilities.mg_recycler.SingleTypePayload;
|
|
import com.discord.utilities.permissions.PermissionUtils;
|
|
import com.discord.widgets.channels.WidgetCreateChannel;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import rx.functions.Func5;
|
|
/* compiled from: WidgetCreateChannel.kt */
|
|
public final class WidgetCreateChannel$Model$Companion$get$1<T1, T2, T3, T4, T5, R> implements Func5<MeUser, Guild, Long, Long, List<? extends GuildRole>, WidgetCreateChannel.Model> {
|
|
public static final WidgetCreateChannel$Model$Companion$get$1 INSTANCE = new WidgetCreateChannel$Model$Companion$get$1();
|
|
|
|
public final WidgetCreateChannel.Model call(MeUser meUser, Guild guild, Long l, Long l2, List<GuildRole> list) {
|
|
if (guild == null || l == null || list == null) {
|
|
return null;
|
|
}
|
|
boolean canAndIsElevated = PermissionUtils.canAndIsElevated(16, Long.valueOf(l2 != null ? l2.longValue() : l.longValue()), meUser.getMfaEnabled(), guild.getMfaLevel());
|
|
boolean contains = guild.getFeatures().contains(GuildFeature.COMMUNITY);
|
|
boolean canAndIsElevated2 = PermissionUtils.canAndIsElevated(268435456, Long.valueOf(l2 != null ? l2.longValue() : l.longValue()), meUser.getMfaEnabled(), guild.getMfaLevel());
|
|
ArrayList arrayList = new ArrayList();
|
|
for (GuildRole guildRole : list) {
|
|
SingleTypePayload singleTypePayload = guildRole.getId() != guild.getId() ? new SingleTypePayload(guildRole, String.valueOf(guildRole.getId()), 0) : null;
|
|
if (singleTypePayload != null) {
|
|
arrayList.add(singleTypePayload);
|
|
}
|
|
}
|
|
return new WidgetCreateChannel.Model(canAndIsElevated, canAndIsElevated2, contains, arrayList, null);
|
|
}
|
|
|
|
/* 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 */ WidgetCreateChannel.Model call(MeUser meUser, Guild guild, Long l, Long l2, List<? extends GuildRole> list) {
|
|
return call(meUser, guild, l, l2, (List<GuildRole>) list);
|
|
}
|
|
}
|