45 lines
1.2 KiB
Java
45 lines
1.2 KiB
Java
package com.discord.stores;
|
|
|
|
import com.discord.api.activity.Activity;
|
|
import com.discord.models.presence.Presence;
|
|
import j0.k.b;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
/* compiled from: StoreUserPresence.kt */
|
|
public final class StoreUserPresence$observeApplicationActivity$1<T, R> implements b<Presence, Activity> {
|
|
public final /* synthetic */ long $applicationId;
|
|
|
|
public StoreUserPresence$observeApplicationActivity$1(long j) {
|
|
this.$applicationId = j;
|
|
}
|
|
|
|
public final Activity call(Presence presence) {
|
|
List<Activity> activities;
|
|
boolean z2;
|
|
T t = null;
|
|
if (presence == null || (activities = presence.getActivities()) == null) {
|
|
return null;
|
|
}
|
|
Iterator<T> it = activities.iterator();
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
break;
|
|
}
|
|
T next = it.next();
|
|
Long a = next.a();
|
|
if (a != null && a.longValue() == this.$applicationId) {
|
|
z2 = true;
|
|
continue;
|
|
} else {
|
|
z2 = false;
|
|
continue;
|
|
}
|
|
if (z2) {
|
|
t = next;
|
|
break;
|
|
}
|
|
}
|
|
return t;
|
|
}
|
|
}
|