use of org.javacord.core.event.user.UserChangeActivityEventImpl in project Javacord by BtoBastian.
the class PresenceUpdateHandler method dispatchUserActivityChangeEvent.
private void dispatchUserActivityChangeEvent(long userId, Set<Activity> newActivities, Set<Activity> oldActivities) {
UserImpl user = api.getCachedUserById(userId).map(UserImpl.class::cast).orElse(null);
UserChangeActivityEvent event = new UserChangeActivityEventImpl(api, userId, newActivities, oldActivities);
api.getEventDispatcher().dispatchUserChangeActivityEvent(api, user == null ? Collections.emptySet() : user.getMutualServers(), user == null ? Collections.emptySet() : Collections.singleton(user), event);
}
Aggregations