In the lobby, a message box will be produced if a message is received with no from attribute. This is assumed to be a system message.
In the referenced ticket, when an affiliation is changed for any player, a message is received from the server with data about the change but with no text. This will spawn an empty message box.
This revision adds a check to make sure the length of the text attribute is greater than 0 before producing a message box or displaying the message in the chat panel.
This is a simple fix to address only the symptom of having an empty message box that must be clicked away any time a user is banned or unbanned.
There is a more complete patch that makes the client aware of different types of xmpp messages we could receive so we can handle each one appropriately. That patch needs to be reimplemented since D2412 has changed most of the code it works on. We should reimplement that patch since that would be the more ideal solution.
Ref: #5348 , D2288
Details
Details
- Reviewers
wraitii - Commits
- rP24609: Do not show message box in lobby for an empty message with no sender.
- Trac Tickets
- #5348
Test that no empty message box is produced when a user is banned or unbanned AND that no blank chat message is displayed in the chat panel.
Test that a message box is still produced for system messages AND that a chat message is correctly displayed in the chat panel for system messages and private messages.
Diff Detail
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
This seems to fix a relatively serious issue and it's straightforward & sane in general -> accept.
The more general handling of messages may still be useful indeed, but not for A24.