Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Stop chat stream for picking up faction/party "private" chat messages #170
Not sure if this is an issue or intentional.
JSONAPI's chat stream picks up messages sent over Faction chat (Factions) and Party chat (mcMMO).
I adjusted the event priority so JSONAPI will not receive events for those messages.
Depending on use cases, picking up those messages may not be a bad thing. In Adminium's case, seeing party/faction chat would be valuable, except that the messages would not appear differently than normal chat messages. In my case, I would not want such messages appearing as I am using the chat stream on a public website.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
Thanks for the PR, but before I merge it, why does heightening the priority make it not receive messages by Factions?
BTW, Including the new build is good here because my CI server doesn't actually do the compiling (not enough memory on the VPS ;( ), but it does extract those artifacts and puts them up for download.
I dug up the event priority stuff here: http://jd.bukkit.org/apidocs/org/bukkit/event/Event.Priority.html
Basically, a high priority means JSONAPI will get the event after plugins with a lower priority. Seems kinda backwards to me-- but that's what the docs say. I've tested it and it works.
When Faction chat or Party chat is on, Factions or mcMMO, respectively, catches the chat event, cancels it, and then sends messages out to the members of the faction/party. So if JSONAPI gets the event after those two plugins, the event will already have been canceled if it was not a public chat, so JSONAPI's handler will not receive the event because ignoreCanceled=true is set. Without the priority set, JSONAPI was getting the chat events before Factions/mcMMO had a chance to cancel it.