Skip to content

Commit

Permalink
Fix roles/groups not being removed instantly upon unlink
Browse files Browse the repository at this point in the history
  • Loading branch information
JRoy authored and mdcfe committed Jun 18, 2023
1 parent d67dd46 commit 03ed9a5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ public boolean removeAccount(final InteractionMember member, final DiscordLinkSt
ensureAsync(() -> {
final IUser user = ess.getEss().getUser(uuid);
ensureSync(() -> ess.getServer().getPluginManager().callEvent(new DiscordLinkStatusChangeEvent(user, member, member.getId(), false, cause)));

roleSyncManager.unSync(uuid, member.getId());
});
return true;
}
ensureAsync(() -> roleSyncManager.unSync(uuid, member.getId()));
return false;
}

Expand All @@ -101,9 +102,10 @@ public boolean removeAccount(final IUser user, final DiscordLinkStatusChangeEven
if (storage.remove(user.getBase().getUniqueId())) {
ess.getApi().getMemberById(id).thenAccept(member -> ensureSync(() ->
ess.getServer().getPluginManager().callEvent(new DiscordLinkStatusChangeEvent(user, member, id, false, cause))));

ensureAsync(() -> roleSyncManager.unSync(user.getBase().getUniqueId(), id));
return true;
}
ensureAsync(() -> roleSyncManager.unSync(user.getBase().getUniqueId(), id));
return false;
}

Expand Down

0 comments on commit 03ed9a5

Please sign in to comment.