Add separate events for local and global chat#4683
Conversation
842e9fb to
45a0678
Compare
45a0678 to
bc14df3
Compare
18f24f7 to
f9e6f52
Compare
|
Hello and thanks for the review! Sorry it took some time, but all noted issues should be fixed now. |
f9e6f52 to
1bf775e
Compare
1bf775e to
a0fc04c
Compare
21b8556 to
0cd4898
Compare
|
Rebased and moved new event classes to |
|
Hey, apologies for the slow response on this. We recently refactored EssentialsX Chat, so this PR will need need to be updated this PR accordingly (ie moving the |
0cd4898 to
c162217
Compare
|
Heyo! I have rebased this on |
8977e3f to
3c60995
Compare
JRoy
left a comment
There was a problem hiding this comment.
final few things, otherwise approved for 2.20!
This commit adds two new events: GlobalChatEvent and LocalChatEvent, which allow other plugin developers to know whether the message sent is a global or local one and act accordingly. If either of those events is cancelled, then the source event is cancelled too. Since all chat-related events share the same structure, a new abstract class ChatEvent is created with change made for LocalChatSpyEvent to use it without breaking its API.
3c60995 to
7bd890d
Compare
Information
This PR helps DiscordSRV/DiscordSRV#1223.
Details
Proposed feature:
This PR adds two new events: GlobalChatEvent and LocalChatEvent, which allow other plugin developers to know whether the message sent is a global or local one and act accordingly. If either of those events is cancelled, then the source event is cancelled too.
Since all chat-related events share the same structure, a new abstract class ChatEvent is created with the change made for LocalChatSpyEvent to use it without breaking its API.
Environments tested:
OS: Windows 10 20H2.
Java version:
Demonstration:
Following this pull request, a draft pull request with the use of that API in Essentials Discord module was created — #4684.