nodejs: fix binding

Change-Id: I6d7fe3f7593764bbb99570ba02b987943ba35a18
This commit is contained in:
Adrien Béraud
2022-08-04 15:00:52 -04:00
parent 2088e38425
commit 19f666f0df

View File

@ -582,6 +582,24 @@ messageReceived(const std::string& accountId,
uv_async_send(&signalAsync);
}
void
conversationProfileUpdated(const std::string& accountId,
const std::string& conversationId ,
const std::map<std::string, std::string>& profile)
{
std::lock_guard<std::mutex> lock(pendingSignalsLock);
pendingSignals.emplace([accountId, conversationId, profile]() {
Local<Function> func = Local<Function>::New(Isolate::GetCurrent(), conversationProfileUpdatedCb);
if (!func.IsEmpty()) {
SWIGV8_VALUE callback_args[] = {V8_STRING_NEW_LOCAL(accountId),
V8_STRING_NEW_LOCAL(conversationId),
stringMapToJsMap(profile)};
func->Call(SWIGV8_CURRENT_CONTEXT(), SWIGV8_NULL(), 3, callback_args);
}
});
uv_async_send(&signalAsync);
}
void
conversationRequestReceived(const std::string& accountId,
const std::string& conversationId,