497 lines
22 KiB
Java
497 lines
22 KiB
Java
package com.discord.stores;
|
|
|
|
import android.content.Context;
|
|
import com.discord.api.guild.Guild;
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventStatus;
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventUserUpdate;
|
|
import com.discord.api.permission.Permission;
|
|
import com.discord.models.domain.ModelPayload;
|
|
import com.discord.stores.updates.ObservationDeck;
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventTiming;
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilitiesKt;
|
|
import com.discord.utilities.permissions.PermissionUtils;
|
|
import com.discord.utilities.rest.RestAPI;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import d0.t.h0;
|
|
import d0.t.n;
|
|
import d0.t.o;
|
|
import d0.z.d.m;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashSet;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import rx.Observable;
|
|
/* compiled from: StoreGuildScheduledEvents.kt */
|
|
public final class StoreGuildScheduledEvents extends StoreV2 {
|
|
private final Dispatcher dispatcher;
|
|
private final HashMap<Long, List<GuildScheduledEvent>> guildScheduledEvents = new HashMap<>();
|
|
private Map<Long, ? extends List<GuildScheduledEvent>> guildScheduledEventsSnapshot = h0.emptyMap();
|
|
private final ObservationDeck observationDeck;
|
|
private final StorePermissions permissionsStore;
|
|
private final HashSet<Long> rsvpsAwaitingNetwork = new HashSet<>();
|
|
private HashSet<Long> rsvpsAwaitingSnapshot = new HashSet<>();
|
|
private final HashMap<Long, GuildScheduledEvent> userGuildScheduledEvents = new HashMap<>();
|
|
private Map<Long, GuildScheduledEvent> userGuildScheduledEventsSnapshot = h0.emptyMap();
|
|
private final StoreUser userStore;
|
|
|
|
public StoreGuildScheduledEvents(Dispatcher dispatcher, ObservationDeck observationDeck, StorePermissions storePermissions, StoreUser storeUser) {
|
|
m.checkNotNullParameter(dispatcher, "dispatcher");
|
|
m.checkNotNullParameter(observationDeck, "observationDeck");
|
|
m.checkNotNullParameter(storePermissions, "permissionsStore");
|
|
m.checkNotNullParameter(storeUser, "userStore");
|
|
this.dispatcher = dispatcher;
|
|
this.observationDeck = observationDeck;
|
|
this.permissionsStore = storePermissions;
|
|
this.userStore = storeUser;
|
|
}
|
|
|
|
public static final /* synthetic */ GuildScheduledEvent access$findEventFromStore(StoreGuildScheduledEvents storeGuildScheduledEvents, GuildScheduledEvent guildScheduledEvent) {
|
|
return storeGuildScheduledEvents.findEventFromStore(guildScheduledEvent);
|
|
}
|
|
|
|
public static final /* synthetic */ Dispatcher access$getDispatcher$p(StoreGuildScheduledEvents storeGuildScheduledEvents) {
|
|
return storeGuildScheduledEvents.dispatcher;
|
|
}
|
|
|
|
public static final /* synthetic */ HashMap access$getGuildScheduledEvents$p(StoreGuildScheduledEvents storeGuildScheduledEvents) {
|
|
return storeGuildScheduledEvents.guildScheduledEvents;
|
|
}
|
|
|
|
public static final /* synthetic */ HashSet access$getRsvpsAwaitingNetwork$p(StoreGuildScheduledEvents storeGuildScheduledEvents) {
|
|
return storeGuildScheduledEvents.rsvpsAwaitingNetwork;
|
|
}
|
|
|
|
public static final /* synthetic */ HashMap access$getUserGuildScheduledEvents$p(StoreGuildScheduledEvents storeGuildScheduledEvents) {
|
|
return storeGuildScheduledEvents.userGuildScheduledEvents;
|
|
}
|
|
|
|
private final GuildScheduledEvent findEventFromStore(GuildScheduledEvent guildScheduledEvent) {
|
|
GuildScheduledEvent findEventFromStore = findEventFromStore(guildScheduledEvent.e(), Long.valueOf(guildScheduledEvent.d()));
|
|
return findEventFromStore != null ? findEventFromStore : guildScheduledEvent;
|
|
}
|
|
|
|
public static /* synthetic */ GuildScheduledEvent findEventFromStore$default(StoreGuildScheduledEvents storeGuildScheduledEvents, long j, Long l, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
l = null;
|
|
}
|
|
return storeGuildScheduledEvents.findEventFromStore(j, l);
|
|
}
|
|
|
|
public static /* synthetic */ List getGuildScheduledEvents$default(StoreGuildScheduledEvents storeGuildScheduledEvents, long j, boolean z2, boolean z3, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z2 = true;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
z3 = true;
|
|
}
|
|
return storeGuildScheduledEvents.getGuildScheduledEvents(j, z2, z3);
|
|
}
|
|
|
|
public static /* synthetic */ Observable observeGuildScheduledEvents$default(StoreGuildScheduledEvents storeGuildScheduledEvents, long j, boolean z2, boolean z3, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z2 = true;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
z3 = true;
|
|
}
|
|
return storeGuildScheduledEvents.observeGuildScheduledEvents(j, z2, z3);
|
|
}
|
|
|
|
private final void processGuildScheduledEventCreateOrUpdate(GuildScheduledEvent guildScheduledEvent) {
|
|
int i;
|
|
long d = guildScheduledEvent.d();
|
|
List<GuildScheduledEvent> list = this.guildScheduledEvents.get(Long.valueOf(d));
|
|
if (list != null) {
|
|
Iterator<GuildScheduledEvent> it = list.iterator();
|
|
i = 0;
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
break;
|
|
}
|
|
if (it.next().e() == guildScheduledEvent.e()) {
|
|
break;
|
|
}
|
|
i++;
|
|
}
|
|
}
|
|
i = -1;
|
|
if (this.guildScheduledEvents.get(Long.valueOf(d)) == null) {
|
|
this.guildScheduledEvents.put(Long.valueOf(d), n.mutableListOf(guildScheduledEvent));
|
|
} else if (i == -1) {
|
|
List<GuildScheduledEvent> list2 = this.guildScheduledEvents.get(Long.valueOf(d));
|
|
if (list2 != null) {
|
|
list2.add(guildScheduledEvent);
|
|
}
|
|
} else {
|
|
List<GuildScheduledEvent> list3 = this.guildScheduledEvents.get(Long.valueOf(d));
|
|
if (list3 != null) {
|
|
list3.set(i, guildScheduledEvent);
|
|
}
|
|
}
|
|
markChanged();
|
|
}
|
|
|
|
@StoreThread
|
|
private final void processRsvpCreate(GuildScheduledEvent guildScheduledEvent, long j) {
|
|
long e = guildScheduledEvent.e();
|
|
if (!this.userGuildScheduledEvents.containsKey(Long.valueOf(e)) || j != this.userStore.getMe().getId()) {
|
|
this.rsvpsAwaitingSnapshot.add(Long.valueOf(e));
|
|
Integer i = guildScheduledEvent.i();
|
|
GuildScheduledEvent a = GuildScheduledEvent.a(guildScheduledEvent, 0, 0, 0, null, null, null, null, null, null, null, null, null, null, null, Integer.valueOf(i != null ? i.intValue() + 1 : 1), null, 49151);
|
|
this.userGuildScheduledEvents.put(Long.valueOf(e), a);
|
|
List<GuildScheduledEvent> list = this.guildScheduledEvents.get(Long.valueOf(a.d()));
|
|
if (list != null) {
|
|
m.checkNotNullExpressionValue(list, "eventList");
|
|
Iterator<GuildScheduledEvent> it = list.iterator();
|
|
int i2 = 0;
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
i2 = -1;
|
|
break;
|
|
}
|
|
if (it.next().e() == e) {
|
|
break;
|
|
}
|
|
i2++;
|
|
}
|
|
if (i2 != -1) {
|
|
list.set(i2, a);
|
|
} else {
|
|
list.add(a);
|
|
}
|
|
} else {
|
|
this.guildScheduledEvents.put(Long.valueOf(guildScheduledEvent.d()), n.mutableListOf(a));
|
|
}
|
|
markChanged();
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void processRsvpCreate$default(StoreGuildScheduledEvents storeGuildScheduledEvents, GuildScheduledEvent guildScheduledEvent, long j, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
j = storeGuildScheduledEvents.userStore.getMe().getId();
|
|
}
|
|
storeGuildScheduledEvents.processRsvpCreate(guildScheduledEvent, j);
|
|
}
|
|
|
|
@StoreThread
|
|
private final void processRsvpDelete(GuildScheduledEvent guildScheduledEvent, long j) {
|
|
long e = guildScheduledEvent.e();
|
|
if (this.userGuildScheduledEvents.containsKey(Long.valueOf(e)) || j != this.userStore.getMe().getId()) {
|
|
this.rsvpsAwaitingSnapshot.add(Long.valueOf(e));
|
|
this.userGuildScheduledEvents.remove(Long.valueOf(e));
|
|
List<GuildScheduledEvent> list = this.guildScheduledEvents.get(Long.valueOf(guildScheduledEvent.d()));
|
|
if (list != null) {
|
|
m.checkNotNullExpressionValue(list, "eventList");
|
|
Iterator<GuildScheduledEvent> it = list.iterator();
|
|
int i = 0;
|
|
int i2 = 0;
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
i2 = -1;
|
|
break;
|
|
}
|
|
if (it.next().e() == e) {
|
|
break;
|
|
}
|
|
i2++;
|
|
}
|
|
Integer valueOf = Integer.valueOf(i2);
|
|
if (!(valueOf.intValue() != -1)) {
|
|
valueOf = null;
|
|
}
|
|
if (valueOf != null) {
|
|
int intValue = valueOf.intValue();
|
|
Integer i3 = guildScheduledEvent.i();
|
|
if (i3 != null) {
|
|
i = i3.intValue() - 1;
|
|
}
|
|
list.set(intValue, GuildScheduledEvent.a(guildScheduledEvent, 0, 0, 0, null, null, null, null, null, null, null, null, null, null, null, Integer.valueOf(i), null, 49151));
|
|
}
|
|
}
|
|
markChanged();
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void processRsvpDelete$default(StoreGuildScheduledEvents storeGuildScheduledEvents, GuildScheduledEvent guildScheduledEvent, long j, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
j = storeGuildScheduledEvents.userStore.getMe().getId();
|
|
}
|
|
storeGuildScheduledEvents.processRsvpDelete(guildScheduledEvent, j);
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:17:0x0063 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:18:0x0073 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:21:0x0088 */
|
|
public final void addGuildScheduledEventFromInvite(GuildScheduledEvent guildScheduledEvent) {
|
|
int i;
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
|
long d = guildScheduledEvent.d();
|
|
List<GuildScheduledEvent> list = this.guildScheduledEvents.get(Long.valueOf(d));
|
|
if (list != null) {
|
|
Iterator<GuildScheduledEvent> it = list.iterator();
|
|
i = 0;
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
break;
|
|
}
|
|
if (it.next().e() == guildScheduledEvent.e()) {
|
|
break;
|
|
}
|
|
i++;
|
|
}
|
|
if (i != -1 && !this.guildScheduledEvents.containsKey(Long.valueOf(d))) {
|
|
this.guildScheduledEvents.put(Long.valueOf(d), n.mutableListOf(guildScheduledEvent));
|
|
} else if (i != -1) {
|
|
((List) h0.getValue(this.guildScheduledEvents, Long.valueOf(d))).add(guildScheduledEvent);
|
|
} else {
|
|
((List) h0.getValue(this.guildScheduledEvents, Long.valueOf(d))).set(i, guildScheduledEvent);
|
|
}
|
|
if (guildScheduledEvent.j() != null) {
|
|
this.userGuildScheduledEvents.put(Long.valueOf(guildScheduledEvent.e()), guildScheduledEvent);
|
|
}
|
|
markChanged();
|
|
}
|
|
i = -1;
|
|
if (i != -1) {
|
|
}
|
|
if (i != -1) {
|
|
}
|
|
if (guildScheduledEvent.j() != null) {
|
|
}
|
|
markChanged();
|
|
}
|
|
|
|
public final void fetchGuildScheduledEventUserCounts(long j) {
|
|
List list = (List) this.guildScheduledEventsSnapshot.get(Long.valueOf(j));
|
|
if (list != null && (!list.isEmpty())) {
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().getGuildScheduledEvents(j, true), false, 1, null), StoreGuildScheduledEvents.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new StoreGuildScheduledEvents$fetchGuildScheduledEventUserCounts$1(this, j), 62, (Object) null);
|
|
}
|
|
}
|
|
|
|
public final void fetchUserGuildScheduledEvents() {
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().getUserGuildScheduledEvents(), false, 1, null), StoreGuildScheduledEvents.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new StoreGuildScheduledEvents$fetchUserGuildScheduledEvents$1(this), 62, (Object) null);
|
|
}
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:15:0x003b, code lost:
|
|
if (r3 != null) goto L_0x006a;
|
|
*/
|
|
public final GuildScheduledEvent findEventFromStore(long j, Long l) {
|
|
GuildScheduledEvent guildScheduledEvent;
|
|
boolean z2;
|
|
Object obj;
|
|
boolean z3;
|
|
Object obj2 = null;
|
|
if (l != null) {
|
|
List list = (List) this.guildScheduledEventsSnapshot.get(Long.valueOf(l.longValue()));
|
|
if (list != null) {
|
|
Iterator it = list.iterator();
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
obj = null;
|
|
break;
|
|
}
|
|
obj = it.next();
|
|
if (j == ((GuildScheduledEvent) obj).e()) {
|
|
z3 = true;
|
|
continue;
|
|
} else {
|
|
z3 = false;
|
|
continue;
|
|
}
|
|
if (z3) {
|
|
break;
|
|
}
|
|
}
|
|
guildScheduledEvent = (GuildScheduledEvent) obj;
|
|
} else {
|
|
guildScheduledEvent = null;
|
|
}
|
|
}
|
|
Iterator it2 = o.flatten(this.guildScheduledEventsSnapshot.values()).iterator();
|
|
while (true) {
|
|
if (!it2.hasNext()) {
|
|
break;
|
|
}
|
|
Object next = it2.next();
|
|
if (j == ((GuildScheduledEvent) next).e()) {
|
|
z2 = true;
|
|
continue;
|
|
} else {
|
|
z2 = false;
|
|
continue;
|
|
}
|
|
if (z2) {
|
|
obj2 = next;
|
|
break;
|
|
}
|
|
}
|
|
guildScheduledEvent = (GuildScheduledEvent) obj2;
|
|
return guildScheduledEvent != null ? guildScheduledEvent : this.userGuildScheduledEvents.get(Long.valueOf(j));
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:35:0x0086 A[SYNTHETIC] */
|
|
/* JADX WARNING: Removed duplicated region for block: B:37:0x004f A[SYNTHETIC] */
|
|
public final List<GuildScheduledEvent> getGuildScheduledEvents(long j, boolean z2, boolean z3) {
|
|
boolean z4;
|
|
Map<Long, Long> permissionsByChannel = this.permissionsStore.getPermissionsByChannel();
|
|
List list = (List) this.guildScheduledEventsSnapshot.get(Long.valueOf(j));
|
|
if (list == null) {
|
|
return n.emptyList();
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
Iterator it = list.iterator();
|
|
while (true) {
|
|
boolean z5 = true;
|
|
if (!it.hasNext()) {
|
|
break;
|
|
}
|
|
Object next = it.next();
|
|
GuildScheduledEvent guildScheduledEvent = (GuildScheduledEvent) next;
|
|
if (z2 && GuildScheduledEventUtilitiesKt.getEventTiming(guildScheduledEvent) == GuildScheduledEventTiming.EXPIRED && guildScheduledEvent.h() != GuildScheduledEventStatus.ACTIVE) {
|
|
z5 = false;
|
|
}
|
|
if (z5) {
|
|
arrayList.add(next);
|
|
}
|
|
}
|
|
ArrayList arrayList2 = new ArrayList();
|
|
for (Object obj : arrayList) {
|
|
GuildScheduledEvent guildScheduledEvent2 = (GuildScheduledEvent) obj;
|
|
if (z3) {
|
|
Long l = permissionsByChannel.get(Long.valueOf(guildScheduledEvent2.b()));
|
|
if (!(l != null ? PermissionUtils.can(Permission.VIEW_CHANNEL, Long.valueOf(l.longValue())) : false)) {
|
|
z4 = false;
|
|
if (!z4) {
|
|
arrayList2.add(obj);
|
|
}
|
|
}
|
|
}
|
|
z4 = true;
|
|
if (!z4) {
|
|
}
|
|
}
|
|
return arrayList2;
|
|
}
|
|
|
|
public final Map<Long, GuildScheduledEvent> getUserGuildScheduledEvents() {
|
|
return this.userGuildScheduledEventsSnapshot;
|
|
}
|
|
|
|
@StoreThread
|
|
public final void handleConnectionOpen(ModelPayload modelPayload) {
|
|
m.checkNotNullParameter(modelPayload, "payload");
|
|
List<Guild> guilds = modelPayload.getGuilds();
|
|
m.checkNotNullExpressionValue(guilds, "payload.guilds");
|
|
for (Guild guild : guilds) {
|
|
List<GuildScheduledEvent> n = guild.n();
|
|
if (n != null) {
|
|
for (GuildScheduledEvent guildScheduledEvent : n) {
|
|
processGuildScheduledEventCreateOrUpdate(guildScheduledEvent);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@StoreThread
|
|
public final void handleGuildCreate(Guild guild) {
|
|
m.checkNotNullParameter(guild, "guild");
|
|
List<GuildScheduledEvent> n = guild.n();
|
|
if (n != null) {
|
|
for (GuildScheduledEvent guildScheduledEvent : n) {
|
|
processGuildScheduledEventCreateOrUpdate(guildScheduledEvent);
|
|
}
|
|
}
|
|
}
|
|
|
|
@StoreThread
|
|
public final void handleGuildScheduledEventCreate(GuildScheduledEvent guildScheduledEvent) {
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
|
processGuildScheduledEventCreateOrUpdate(guildScheduledEvent);
|
|
}
|
|
|
|
@StoreThread
|
|
public final void handleGuildScheduledEventDelete(GuildScheduledEvent guildScheduledEvent) {
|
|
List<GuildScheduledEvent> list;
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
|
List<GuildScheduledEvent> list2 = this.guildScheduledEvents.get(Long.valueOf(guildScheduledEvent.d()));
|
|
if (list2 != null) {
|
|
Iterator<GuildScheduledEvent> it = list2.iterator();
|
|
int i = 0;
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
i = -1;
|
|
break;
|
|
}
|
|
if (it.next().e() == guildScheduledEvent.e()) {
|
|
break;
|
|
}
|
|
i++;
|
|
}
|
|
if (!(i == -1 || (list = this.guildScheduledEvents.get(Long.valueOf(guildScheduledEvent.d()))) == null)) {
|
|
list.remove(i);
|
|
}
|
|
this.userGuildScheduledEvents.remove(Long.valueOf(guildScheduledEvent.e()));
|
|
markChanged();
|
|
}
|
|
}
|
|
|
|
@StoreThread
|
|
public final void handleGuildScheduledEventUpdate(GuildScheduledEvent guildScheduledEvent) {
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
|
processGuildScheduledEventCreateOrUpdate(guildScheduledEvent);
|
|
}
|
|
|
|
@StoreThread
|
|
public final void handleGuildScheduledEventUserCreate(GuildScheduledEventUserUpdate guildScheduledEventUserUpdate) {
|
|
m.checkNotNullParameter(guildScheduledEventUserUpdate, "guildScheduledEventUserUpdate");
|
|
GuildScheduledEvent findEventFromStore$default = findEventFromStore$default(this, guildScheduledEventUserUpdate.a(), null, 2, null);
|
|
if (findEventFromStore$default != null) {
|
|
processRsvpCreate(findEventFromStore$default, guildScheduledEventUserUpdate.b());
|
|
}
|
|
}
|
|
|
|
@StoreThread
|
|
public final void handleGuildScheduledEventUserDelete(GuildScheduledEventUserUpdate guildScheduledEventUserUpdate) {
|
|
m.checkNotNullParameter(guildScheduledEventUserUpdate, "guildScheduledEventUserUpdate");
|
|
GuildScheduledEvent findEventFromStore$default = findEventFromStore$default(this, guildScheduledEventUserUpdate.a(), null, 2, null);
|
|
if (findEventFromStore$default != null) {
|
|
processRsvpDelete(findEventFromStore$default, guildScheduledEventUserUpdate.b());
|
|
}
|
|
}
|
|
|
|
public final boolean isRsvpedToEvent(long j) {
|
|
return this.userGuildScheduledEventsSnapshot.containsKey(Long.valueOf(j));
|
|
}
|
|
|
|
public final Observable<GuildScheduledEvent> observeGuildScheduledEvent(Long l, Long l2) {
|
|
return ObservationDeck.connectRx$default(this.observationDeck, new ObservationDeck.UpdateSource[]{this}, false, null, null, new StoreGuildScheduledEvents$observeGuildScheduledEvent$1(this, l, l2), 14, null);
|
|
}
|
|
|
|
public final Observable<List<GuildScheduledEvent>> observeGuildScheduledEvents(long j, boolean z2, boolean z3) {
|
|
return ObservationDeck.connectRx$default(this.observationDeck, new ObservationDeck.UpdateSource[]{this}, false, null, null, new StoreGuildScheduledEvents$observeGuildScheduledEvents$1(this, j, z2, z3), 14, null);
|
|
}
|
|
|
|
@Override // com.discord.stores.StoreV2
|
|
public void snapshotData() {
|
|
super.snapshotData();
|
|
this.guildScheduledEventsSnapshot = new HashMap(this.guildScheduledEvents);
|
|
this.userGuildScheduledEventsSnapshot = new HashMap(this.userGuildScheduledEvents);
|
|
this.rsvpsAwaitingSnapshot.clear();
|
|
}
|
|
|
|
public final void toggleRsvpGuildScheduledEvent(GuildScheduledEvent guildScheduledEvent) {
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
|
GuildScheduledEvent findEventFromStore = findEventFromStore(guildScheduledEvent);
|
|
long e = findEventFromStore.e();
|
|
if (!this.rsvpsAwaitingNetwork.contains(Long.valueOf(e)) && !this.rsvpsAwaitingSnapshot.contains(Long.valueOf(e))) {
|
|
this.rsvpsAwaitingNetwork.add(Long.valueOf(e));
|
|
this.dispatcher.schedule(new StoreGuildScheduledEvents$toggleRsvpGuildScheduledEvent$1(this, e, findEventFromStore));
|
|
}
|
|
}
|
|
}
|