40 lines
2.1 KiB
Java
40 lines
2.1 KiB
Java
package com.discord.widgets.mobile_reports;
|
|
|
|
import com.discord.api.report.ReportType;
|
|
import com.discord.app.AppViewModel;
|
|
import com.discord.utilities.intent.IntentUtilsKt;
|
|
import com.discord.widgets.mobile_reports.MobileReportsViewModel;
|
|
import d0.z.d.o;
|
|
import java.io.Serializable;
|
|
import java.lang.ref.WeakReference;
|
|
import java.util.Objects;
|
|
import kotlin.jvm.functions.Function0;
|
|
/* compiled from: WidgetMobileReports.kt */
|
|
public final class WidgetMobileReports$viewModel$2 extends o implements Function0<AppViewModel<MobileReportsViewModel.ViewState>> {
|
|
public final /* synthetic */ WidgetMobileReports this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetMobileReports$viewModel$2(WidgetMobileReports widgetMobileReports) {
|
|
super(0);
|
|
this.this$0 = widgetMobileReports;
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
/* renamed from: invoke */
|
|
public final AppViewModel<MobileReportsViewModel.ViewState> mo1invoke() {
|
|
long longExtra = this.this$0.getMostRecentIntent().getLongExtra("MESSAGE_ID", -1);
|
|
Long longExtraOrNull = IntentUtilsKt.getLongExtraOrNull(this.this$0.getMostRecentIntent(), "CHANNEL_ID");
|
|
if (longExtraOrNull != null) {
|
|
long longValue = longExtraOrNull.longValue();
|
|
Serializable serializableExtra = this.this$0.getMostRecentIntent().getSerializableExtra("REPORT_TYPE");
|
|
Objects.requireNonNull(serializableExtra, "null cannot be cast to non-null type com.discord.api.report.ReportType");
|
|
ReportType reportType = (ReportType) serializableExtra;
|
|
if (reportType != ReportType.Message || longExtra != -1) {
|
|
return new MobileReportsViewModel(new WeakReference(this.this$0.requireContext()), longValue, longExtra, reportType, null, null, null, 112, null);
|
|
}
|
|
throw new IllegalStateException("You must provide a message ID when submitting a message report");
|
|
}
|
|
throw new IllegalStateException("You must provide a channel ID to submit a report");
|
|
}
|
|
}
|