Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
2eedc6b2
Commit
2eedc6b2
authored
2 months ago
by
Léopold Chappuis
Browse files
Options
Downloads
Patches
Plain Diff
nodejs: add userSearch signal
Change-Id: I7ceb5c0809918ca53cbcf2bc1c0d8efff586f960
parent
b85165ae
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/nodejs/callback.h
+21
-0
21 additions, 0 deletions
bin/nodejs/callback.h
bin/nodejs/nodejs_interface.i
+1
-0
1 addition, 0 deletions
bin/nodejs/nodejs_interface.i
with
22 additions
and
0 deletions
bin/nodejs/callback.h
+
21
−
0
View file @
2eedc6b2
...
...
@@ -54,6 +54,7 @@ Persistent<Function> conversationPreferencesUpdatedCb;
Persistent
<
Function
>
messageSendCb
;
Persistent
<
Function
>
accountProfileReceivedCb
;
Persistent
<
Function
>
profileReceivedCb
;
Persistent
<
Function
>
userSearchEndedCb
;
std
::
queue
<
std
::
function
<
void
()
>>
pendingSignals
;
std
::
mutex
pendingSignalsLock
;
...
...
@@ -153,6 +154,8 @@ getPresistentCb(std::string_view signal)
return
&
accountProfileReceivedCb
;
else
if
(
signal
==
"ProfileReceived"
)
return
&
profileReceivedCb
;
else
if
(
signal
==
"UserSearchEnded"
)
return
&
userSearchEndedCb
;
else
return
nullptr
;
}
...
...
@@ -556,6 +559,24 @@ knownDevicesChanged(const std::string& accountId, const std::map<std::string, st
uv_async_send
(
&
signalAsync
);
}
void
userSearchEnded
(
const
std
::
string
&
accountId
,
int
state
,
const
std
::
string
&
query
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>&
results
)
{
std
::
lock_guard
lock
(
pendingSignalsLock
);
pendingSignals
.
emplace
([
accountId
,
state
,
query
,
results
]()
{
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
userSearchEndedCb
);
if
(
!
func
.
IsEmpty
())
{
SWIGV8_VALUE
callback_args
[]
=
{
V8_STRING_NEW_LOCAL
(
accountId
),
SWIGV8_INTEGER_NEW
(
state
),
V8_STRING_NEW_LOCAL
(
query
),
stringMapVecToJsMapArray
(
results
)};
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
(),
SWIGV8_NULL
(),
4
,
callback_args
);
}
});
uv_async_send
(
&
signalAsync
);
}
void
incomingTrustRequest
(
const
std
::
string
&
accountId
,
const
std
::
string
&
from
,
...
...
This diff is collapsed.
Click to expand it.
bin/nodejs/nodejs_interface.i
+
1
−
0
View file @
2eedc6b2
...
...
@@ -144,6 +144,7 @@ void init(const SWIGV8_VALUE& funcMap){
exportable_callback<ConfigurationSignal::ProfileReceived>(bind(&profileReceived, _1, _2, _3)),
exportable_callback<ConfigurationSignal::AccountProfileReceived>(bind(&accountProfileReceived, _1, _2, _3)),
//exportable_callback<ConfigurationSignal::IncomingTrustRequest>(bind(&incomingTrustRequest, _1, _2, _3, _4, _5 )),
exportable_callback<ConfigurationSignal::UserSearchEnded>(bind(&userSearchEnded, _1, _2, _3, _4 )),
};
const std::map<std::string, SharedCallback> dataTransferEvHandlers = {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment