From 19f666f0df90a8d734e8c39acc234a046d7cc7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Thu, 4 Aug 2022 15:00:52 -0400 Subject: [PATCH] nodejs: fix binding Change-Id: I6d7fe3f7593764bbb99570ba02b987943ba35a18 --- bin/nodejs/callback.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bin/nodejs/callback.h b/bin/nodejs/callback.h index f949639d8..c93f010de 100644 --- a/bin/nodejs/callback.h +++ b/bin/nodejs/callback.h @@ -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& profile) +{ + std::lock_guard lock(pendingSignalsLock); + pendingSignals.emplace([accountId, conversationId, profile]() { + Local func = Local::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,