Differential D1781 Diff 12020 binaries/data/mods/public/gui/lobby/LobbyPage/Chat/ChatMessagesPanel.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/LobbyPage/Chat/ChatMessagesPanel.js
Show All 18 Lines | class ChatMessagesPanel | ||||
} | } | ||||
addText(timestamp, text) | addText(timestamp, text) | ||||
{ | { | ||||
if (this.timestampWrapper) | if (this.timestampWrapper) | ||||
text = this.timestampWrapper.format(timestamp, text); | text = this.timestampWrapper.format(timestamp, text); | ||||
this.chatHistory += this.chatHistory ? "\n" + text : text; | this.chatHistory += this.chatHistory ? "\n" + text : text; | ||||
this.chatText.pushItem(text); | |||||
Stan: I guess it can't be called append? | |||||
Done Inline ActionsIt can, but I preferred to re-use the C++ name. I'm not sure it's obviously better. wraitii: It can, but I preferred to re-use the C++ name. I'm not sure it's obviously better. | |||||
if (!this.hasUpdate) | if (!this.hasUpdate) | ||||
{ | { | ||||
this.hasUpdate = true; | this.hasUpdate = true; | ||||
// Most xmpp messages are not chat messages, hence | // Most xmpp messages are not chat messages, hence | ||||
// only subscribe the event handler when relevant to improve performance. | // only subscribe the event handler when relevant to improve performance. | ||||
this.xmppMessages.registerMessageBatchProcessedHandler(this.flushEvent); | this.xmppMessages.registerMessageBatchProcessedHandler(this.flushEvent); | ||||
} | } | ||||
} | } | ||||
flushMessages() | flushMessages() | ||||
{ | { | ||||
if (this.hasUpdate) | if (this.hasUpdate) | ||||
{ | { | ||||
this.chatText.caption = this.chatHistory; | |||||
this.hasUpdate = false; | this.hasUpdate = false; | ||||
this.xmppMessages.unregisterMessageBatchProcessedHandler(this.flushEvent); | this.xmppMessages.unregisterMessageBatchProcessedHandler(this.flushEvent); | ||||
} | } | ||||
} | } | ||||
clearChatMessages() | clearChatMessages() | ||||
{ | { | ||||
this.chatHistory = ""; | this.chatHistory = ""; | ||||
this.chatText.caption = ""; | this.chatText.caption = ""; | ||||
} | } | ||||
} | } |
Wildfire Games · Phabricator
I guess it can't be called append?