mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Don't publish/broadcast log entries from the import process - towards #317
This commit is contained in:
parent
03f342a21c
commit
dadd8e2c50
@ -45,10 +45,16 @@ public class LogDispatcher {
|
||||
private final LuckPermsPlugin plugin;
|
||||
|
||||
public void dispatch(LogEntry entry, Sender sender) {
|
||||
if (!plugin.getApiProvider().getEventFactory().handleLogPublish(false, entry)) {
|
||||
// set the event to cancelled if the sender is import
|
||||
if (!plugin.getApiProvider().getEventFactory().handleLogPublish(sender.isImport(), entry)) {
|
||||
plugin.getStorage().logAction(entry);
|
||||
}
|
||||
|
||||
// don't dispatch log entries sent by an import process
|
||||
if (sender.isImport()) {
|
||||
return;
|
||||
}
|
||||
|
||||
InternalMessagingService messagingService = plugin.getMessagingService();
|
||||
if (!sender.isImport() && !(messagingService instanceof NoopMessagingService)) {
|
||||
messagingService.pushLog(entry);
|
||||
|
@ -134,7 +134,8 @@ public final class AbstractSender<T> implements Sender {
|
||||
|
||||
@Override
|
||||
public boolean isImport() {
|
||||
return this.uuid.equals(Constants.IMPORT_UUID);
|
||||
// the importer uses it's own instance of Sender
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user