Fix historic lobby kick messages following arbitrary CreateGUIMessage arguments in 9023f4bebb/D2264.
Perform the freezing for historic messages equally. Differential Revision: https://code.wildfiregames.com/D2282 Tested on: clang 8.0.1, Jenkins This was SVN commit r22887.
This commit is contained in:
parent
2233a76e2a
commit
f77a3e289c
@ -668,7 +668,13 @@ void XmppClient::CreateGUIMessage(
|
||||
JSContext* cx = m_ScriptInterface->GetContext();
|
||||
JSAutoRequest rq(cx);
|
||||
JS::RootedValue message(cx);
|
||||
m_ScriptInterface->CreateObject(&message, "type", type, "level", level, "time", static_cast<double>(time));
|
||||
m_ScriptInterface->CreateObject(
|
||||
&message,
|
||||
"type", type,
|
||||
"level", level,
|
||||
"historic", false,
|
||||
"time", static_cast<double>(time));
|
||||
|
||||
JS::RootedObject messageObj(cx, message.toObjectOrNull());
|
||||
SetGUIMessageProperty(cx, messageObj, args...);
|
||||
m_ScriptInterface->FreezeObject(message, true);
|
||||
@ -697,6 +703,7 @@ JS::Value XmppClient::GuiPollNewMessage(const ScriptInterface& scriptInterface)
|
||||
if (JS_StructuredClone(cx, message, &messageCopy, nullptr, nullptr))
|
||||
{
|
||||
scriptInterface.SetProperty(messageCopy, "historic", true);
|
||||
scriptInterface.FreezeObject(messageCopy, true);
|
||||
m_HistoricGuiMessages.push_back(JS::Heap<JS::Value>(messageCopy));
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user