51 lines
2.7 KiB
Java
51 lines
2.7 KiB
Java
package com.discord.utilities.channel;
|
|
|
|
import android.content.Context;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.widgets.channels.WidgetGroupInviteFriends;
|
|
import com.discord.widgets.channels.invite.GroupInviteFriendsSheet;
|
|
import com.discord.widgets.channels.invite.GroupInviteFriendsSheetFeatureFlag;
|
|
import com.discord.widgets.guilds.invite.WidgetGuildInviteShare;
|
|
import d0.z.d.m;
|
|
/* compiled from: ChannelInviteLaunchUtils.kt */
|
|
public final class ChannelInviteLaunchUtils {
|
|
public static final ChannelInviteLaunchUtils INSTANCE = new ChannelInviteLaunchUtils();
|
|
|
|
private ChannelInviteLaunchUtils() {
|
|
}
|
|
|
|
public static /* synthetic */ void inviteToChannel$default(ChannelInviteLaunchUtils channelInviteLaunchUtils, Fragment fragment, Channel channel, String str, Long l, int i, Object obj) {
|
|
if ((i & 8) != 0) {
|
|
l = null;
|
|
}
|
|
channelInviteLaunchUtils.inviteToChannel(fragment, channel, str, l);
|
|
}
|
|
|
|
public final void inviteToChannel(Fragment fragment, Channel channel, String str, Long l) {
|
|
m.checkNotNullParameter(fragment, "fragment");
|
|
m.checkNotNullParameter(str, "source");
|
|
if (channel != null) {
|
|
long h = channel.h();
|
|
if (channel.f() != 0) {
|
|
WidgetGuildInviteShare.Companion companion = WidgetGuildInviteShare.Companion;
|
|
Context requireContext = fragment.requireContext();
|
|
m.checkNotNullExpressionValue(requireContext, "fragment.requireContext()");
|
|
FragmentManager childFragmentManager = fragment.getChildFragmentManager();
|
|
m.checkNotNullExpressionValue(childFragmentManager, "fragment.childFragmentManager");
|
|
WidgetGuildInviteShare.Companion.launch$default(companion, requireContext, childFragmentManager, channel.f(), Long.valueOf(h), false, l, str, 16, null);
|
|
} else if (GroupInviteFriendsSheetFeatureFlag.Companion.getINSTANCE().isEnabled()) {
|
|
GroupInviteFriendsSheet.Companion companion2 = GroupInviteFriendsSheet.Companion;
|
|
FragmentManager childFragmentManager2 = fragment.getChildFragmentManager();
|
|
m.checkNotNullExpressionValue(childFragmentManager2, "fragment.childFragmentManager");
|
|
companion2.show(childFragmentManager2, h, str);
|
|
} else {
|
|
WidgetGroupInviteFriends.Companion companion3 = WidgetGroupInviteFriends.Companion;
|
|
Context requireContext2 = fragment.requireContext();
|
|
m.checkNotNullExpressionValue(requireContext2, "fragment.requireContext()");
|
|
companion3.launch(requireContext2, h, str);
|
|
}
|
|
}
|
|
}
|
|
}
|