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
43c4c185
Commit
43c4c185
authored
3 years ago
by
Olivier Dion
Browse files
Options
Downloads
Patches
Plain Diff
agent: Make activate work
Change-Id: I08dc1c58529872c031ce9e5c36706173857f3f83
parent
66d5d955
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
test/agent/agent.cpp
+3
-32
3 additions, 32 deletions
test/agent/agent.cpp
with
3 additions
and
32 deletions
test/agent/agent.cpp
+
3
−
32
View file @
43c4c185
...
...
@@ -229,42 +229,13 @@ Agent::setDetails(const std::map<std::string, std::string>& details)
}
void
Agent
::
activate
(
bool
stat
e
)
Agent
::
activate
(
bool
enabl
e
)
{
LOG_AGENT_STATE
();
std
::
mutex
mtx
;
std
::
condition_variable
cv
;
bool
done
=
false
;
onVolatileDetailsChanged_
.
add
([
&
](
const
std
::
string
&
accountID
,
const
std
::
map
<
std
::
string
,
std
::
string
>&
details
)
{
if
(
accountID_
!=
accountID
)
{
return
true
;
}
AGENT_INFO
(
"Account is %s"
,
details
.
at
(
DRing
::
Account
::
VolatileProperties
::
ACTIVE
).
c_str
());
std
::
unique_lock
lk
(
mtx
);
done
=
true
;
cv
.
notify_one
();
return
false
;
});
DRing
::
setAccountActive
(
accountID_
,
state
);
std
::
unique_lock
lk
(
mtx
);
cv
.
wait_for
(
lk
,
std
::
chrono
::
seconds
(
10
),
[
&
]{
return
done
;
});
DRing
::
sendRegister
(
accountID_
,
enable
);
if
(
stat
e
)
{
if
(
enabl
e
)
{
waitForAnnouncement
();
}
}
...
...
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