Differential D2412 Diff 10357 binaries/data/mods/public/gui/lobby/LobbyPage/Chat/ChatMessages/ChatMessageEvents.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/LobbyPage/Chat/ChatMessages/ChatMessageEvents.js
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
/** | |||||
* This is the class (and only class) that formats textual messages submitted by chat participants. | |||||
*/ | |||||
ChatMessageEvents.PlayerChat = class | |||||
{ | |||||
constructor(xmppMessages, chat) | |||||
{ | |||||
this.chat = chat; | |||||
this.chatMessageFormat = new ChatMessageFormat(); | |||||
xmppMessages.registerHandler("chat", "room-message", this.onRoomMessage.bind(this)); | |||||
xmppMessages.registerHandler("chat", "private-message", this.onPrivateMessage.bind(this)); | |||||
} | |||||
onRoomMessage(message) | |||||
{ | |||||
this.chat.addText(message.time, this.chatMessageFormat.format(message)); | |||||
} | |||||
onPrivateMessage(message) | |||||
{ | |||||
// We intend to not support private messages between users | |||||
if (!message.from || Engine.LobbyGetPlayerRole(message.from) == "moderator") | |||||
Freagarach: +`.` | |||||
// some XMPP clients send trailing whitespace | |||||
this.addText(message.time, this.chatMessageFormat.format(message)); | |||||
Not Done Inline ActionsS+. Freagarach: `S`+`.` | |||||
} | |||||
}; |
Wildfire Games · Phabricator
+.