Differential D3354 Diff 15305 ps/trunk/binaries/data/mods/public/gui/lobby/LobbyPage/AnnouncementHandler.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/lobby/LobbyPage/AnnouncementHandler.js
/** | /** | ||||
* This class informs clients of the server if an announcement had been broadcasted. | * This class informs clients of the server if an announcement had been broadcasted. | ||||
*/ | */ | ||||
class AnnouncementHandler | class AnnouncementHandler | ||||
{ | { | ||||
constructor(xmppMessages) | constructor(xmppMessages) | ||||
{ | { | ||||
xmppMessages.registerXmppMessageHandler("chat", "private-message", this.onPrivateMessage.bind(this)); | xmppMessages.registerXmppMessageHandler("chat", "private-message", this.onPrivateMessage.bind(this)); | ||||
} | } | ||||
onPrivateMessage(message) | onPrivateMessage(message) | ||||
{ | { | ||||
// Announcements and the Message of the Day are sent by the server directly | // Announcements and the Message of the Day are sent by the server directly | ||||
if (!message.from) | if (!message.from && message.text.length > 0) | ||||
messageBox( | messageBox( | ||||
400, 250, | 400, 250, | ||||
message.text.trim(), | message.text.trim(), | ||||
translate("Notice")); | translate("Notice")); | ||||
} | } | ||||
} | } |
Wildfire Games · Phabricator