Fix duplicated messages with /helpop (#5776)

This commit is contained in:
Charles DeLancey 2024-04-29 21:26:49 -04:00 committed by GitHub
parent 549283a1e5
commit cde7184da3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,7 +51,10 @@ public class Commandhelpop extends EssentialsCommand {
final HelpopMessageSendEvent sendEvent = new HelpopMessageSendEvent(from, recipients, message); final HelpopMessageSendEvent sendEvent = new HelpopMessageSendEvent(from, recipients, message);
ess.getServer().getPluginManager().callEvent(sendEvent); ess.getServer().getPluginManager().callEvent(sendEvent);
final IUser sender = (IUser) from;
if(!recipients.contains(sender)){
from.sendTl("helpOp", from.getDisplayName(), message); from.sendTl("helpOp", from.getDisplayName(), message);
}
for (IUser recipient : sendEvent.getRecipients()) { for (IUser recipient : sendEvent.getRecipients()) {
recipient.sendTl("helpOp", from.getDisplayName(), message); recipient.sendTl("helpOp", from.getDisplayName(), message);