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
3e586b0d
Commit
3e586b0d
authored
2 months ago
by
Léopold Chappuis
Committed by
Adrien Béraud
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
deviceRevocationEnded : add signal callback for nodeJs
Change-Id: I9853bfd5742f751c4e20ee4668feed550013561a
parent
6c639d23
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/nodejs/callback.h
+20
-0
20 additions, 0 deletions
bin/nodejs/callback.h
with
20 additions
and
0 deletions
bin/nodejs/callback.h
+
20
−
0
View file @
3e586b0d
...
...
@@ -55,6 +55,7 @@ Persistent<Function> messageSendCb;
Persistent
<
Function
>
accountProfileReceivedCb
;
Persistent
<
Function
>
profileReceivedCb
;
Persistent
<
Function
>
userSearchEndedCb
;
Persistent
<
Function
>
deviceRevocationEndedCb
;
std
::
queue
<
std
::
function
<
void
()
>>
pendingSignals
;
std
::
mutex
pendingSignalsLock
;
...
...
@@ -156,6 +157,8 @@ getPresistentCb(std::string_view signal)
return
&
profileReceivedCb
;
else
if
(
signal
==
"UserSearchEnded"
)
return
&
userSearchEndedCb
;
else
if
(
signal
==
"DeviceRevocationEnded"
)
return
&
deviceRevocationEndedCb
;
else
return
nullptr
;
}
...
...
@@ -577,6 +580,23 @@ userSearchEnded(const std::string& accountId,int state, const std::string& query
uv_async_send
(
&
signalAsync
);
}
void
deviceRevocationEnded
(
const
std
::
string
&
accountId
,
const
std
::
string
&
device
,
int
status
)
{
std
::
lock_guard
lock
(
pendingSignalsLock
);
pendingSignals
.
emplace
([
accountId
,
device
,
status
]()
{
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
deviceRevocationEndedCb
);
if
(
!
func
.
IsEmpty
())
{
SWIGV8_VALUE
callback_args
[]
=
{
V8_STRING_NEW_LOCAL
(
accountId
),
V8_STRING_NEW_LOCAL
(
device
),
SWIGV8_INTEGER_NEW
(
status
)};
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
(),
SWIGV8_NULL
(),
3
,
callback_args
);
}
});
uv_async_send
(
&
signalAsync
);
}
void
incomingTrustRequest
(
const
std
::
string
&
accountId
,
const
std
::
string
&
from
,
...
...
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