Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

Don't call PrivateMessageSentEvent if the message wasn't sent successfully

Open Krakenied opened this issue 2 years ago • 1 comments

Don't call PrivateMessageSentEvent if the message wasn't sent successfully

Information

PrivateMessageSentEvent is called even if the message wasn't actually sent (/reply command).

Details

Proposed fix:

Don't call PrivateMessageSentEvent if the message wasn't sent successfully.

Environments tested:

OS: Windows 10 Home 64-bit (21H2, 19044.1865)

Java version: 18

  • [x] Most recent Paper version (1.XX.Y, git-Paper-BUILD)
  • [ ] CraftBukkit/Spigot/Paper 1.12.2
  • [ ] CraftBukkit 1.8.8

Krakenied avatar Aug 10 '22 07:08 Krakenied

This appears to be intentional behaviour? PrivateMessageSentEvent includes a status enum for checking whether a message was sent successfully or not. Admittedly the event name isn't completely clear, but we can't change that without breaking API.

mdcfe avatar Aug 10 '22 14:08 mdcfe