2021-09-27 20:31:35 +00:00
|
|
|
package com.discord.widgets.guildscheduledevent;
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
import androidx.activity.result.ActivityResult;
|
|
|
|
import androidx.activity.result.ActivityResultCallback;
|
|
|
|
import androidx.fragment.app.Fragment;
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.z.d.m;
|
2021-09-27 20:31:35 +00:00
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.app.AppBottomSheet;
|
|
|
|
import com.discord.app.AppFragment;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.intent.IntentUtilsKt;
|
|
|
|
import com.discord.widgets.voice.VoiceUtils;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
/* compiled from: WidgetPreviewGuildScheduledEvent.kt */
|
|
|
|
public final class WidgetPreviewGuildScheduledEvent$Companion$createJoinOnStartActivityRegistration$1<O> implements ActivityResultCallback<ActivityResult> {
|
|
|
|
public final /* synthetic */ Fragment $fragment;
|
|
|
|
public final /* synthetic */ Function0 $onEventStarted;
|
|
|
|
|
|
|
|
public WidgetPreviewGuildScheduledEvent$Companion$createJoinOnStartActivityRegistration$1(Fragment fragment, Function0 function0) {
|
|
|
|
this.$fragment = fragment;
|
|
|
|
this.$onEventStarted = function0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void onActivityResult(ActivityResult activityResult) {
|
|
|
|
Intent data;
|
|
|
|
Long longExtraOrNull;
|
|
|
|
Channel channel;
|
|
|
|
m.checkNotNullExpressionValue(activityResult, "activityResult");
|
|
|
|
if (activityResult.getResultCode() == -1 && (data = activityResult.getData()) != null && (longExtraOrNull = IntentUtilsKt.getLongExtraOrNull(data, "com.discord.intent.extra.EXTRA_CHANNEL_ID")) != null && (channel = StoreStream.Companion.getChannels().getChannel(longExtraOrNull.longValue())) != null) {
|
|
|
|
Fragment fragment = this.$fragment;
|
|
|
|
if (fragment instanceof AppFragment) {
|
2021-09-30 06:24:59 +00:00
|
|
|
VoiceUtils.handleConnectToEventChannel(channel, (AppFragment) fragment, this.$onEventStarted);
|
2021-09-27 20:31:35 +00:00
|
|
|
} else if (fragment instanceof AppBottomSheet) {
|
2021-09-30 06:24:59 +00:00
|
|
|
VoiceUtils.handleConnectToEventChannel(channel, (AppBottomSheet) fragment, this.$onEventStarted);
|
2021-09-27 20:31:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|