42 lines
2 KiB
Java
42 lines
2 KiB
Java
|
package com.discord.utilities.channel;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import com.discord.R;
|
||
|
import com.discord.api.channel.Channel;
|
||
|
import com.discord.utilities.accessibility.AccessibilityUtils;
|
||
|
import com.discord.utilities.permissions.PermissionUtils;
|
||
|
import d0.z.d.m;
|
||
|
import d0.z.d.o;
|
||
|
import kotlin.jvm.functions.Function0;
|
||
|
/* compiled from: ChannelSelector.kt */
|
||
|
public final class ChannelSelector$findAndSet$1 extends o implements Function0<Channel> {
|
||
|
public final /* synthetic */ long $channelId;
|
||
|
public final /* synthetic */ Context $context;
|
||
|
public final /* synthetic */ ChannelSelector this$0;
|
||
|
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public ChannelSelector$findAndSet$1(ChannelSelector channelSelector, long j, Context context) {
|
||
|
super(0);
|
||
|
this.this$0 = channelSelector;
|
||
|
this.$channelId = j;
|
||
|
this.$context = context;
|
||
|
}
|
||
|
|
||
|
@Override // kotlin.jvm.functions.Function0
|
||
|
/* renamed from: invoke */
|
||
|
public final Channel mo1invoke() {
|
||
|
Channel findChannelByIdInternal$app_productionBetaRelease = this.this$0.getStream().getChannels$app_productionBetaRelease().findChannelByIdInternal$app_productionBetaRelease(this.$channelId);
|
||
|
if (findChannelByIdInternal$app_productionBetaRelease != null && PermissionUtils.INSTANCE.hasAccess(findChannelByIdInternal$app_productionBetaRelease, this.this$0.getStream().getPermissions$app_productionBetaRelease().getPermissionsByChannel().get(Long.valueOf(this.$channelId)))) {
|
||
|
return findChannelByIdInternal$app_productionBetaRelease;
|
||
|
}
|
||
|
Context context = this.$context;
|
||
|
if (context != null) {
|
||
|
AccessibilityUtils accessibilityUtils = AccessibilityUtils.INSTANCE;
|
||
|
String string = context.getString(R.string.inaccessible_channel_link_title);
|
||
|
m.checkNotNullExpressionValue(string, "context.getString(R.stri…sible_channel_link_title)");
|
||
|
accessibilityUtils.sendAnnouncement(context, string);
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
}
|