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
1cc0d1bd
Commit
1cc0d1bd
authored
5 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
presence: support Jami accounts for setSubscriptions
Change-Id: I6ad0e5cefdb677d51cb75745b6c86b245753f18e
parent
fdb9bfec
Branches
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
src/client/presencemanager.cpp
+12
-5
12 additions, 5 deletions
src/client/presencemanager.cpp
with
12 additions
and
5 deletions
src/client/presencemanager.cpp
+
12
−
5
View file @
1cc0d1bd
...
...
@@ -121,7 +121,9 @@ getSubscriptions(const std::string& accountID)
if
(
auto
sipaccount
=
jami
::
Manager
::
instance
().
getAccount
<
SIPAccount
>
(
accountID
))
{
if
(
auto
pres
=
sipaccount
->
getPresence
())
{
for
(
const
auto
&
s
:
pres
->
getClientSubscriptions
())
{
auto
subs
=
pres
->
getClientSubscriptions
();
ret
.
reserve
(
subs
.
size
());
for
(
const
auto
&
s
:
subs
)
{
ret
.
push_back
({
{
DRing
::
Presence
::
BUDDY_KEY
,
s
->
getURI
()},
{
DRing
::
Presence
::
STATUS_KEY
,
s
->
isPresent
()
?
DRing
::
Presence
::
ONLINE_KEY
:
DRing
::
Presence
::
OFFLINE_KEY
},
...
...
@@ -131,11 +133,13 @@ getSubscriptions(const std::string& accountID)
}
else
JAMI_ERR
(
"Presence not initialized"
);
}
else
if
(
auto
ringaccount
=
jami
::
Manager
::
instance
().
getAccount
<
jami
::
JamiAccount
>
(
accountID
))
{
for
(
const
auto
&
tracked_id
:
ringaccount
->
getTrackedBuddyPresence
())
{
const
auto
&
trackedBuddies
=
ringaccount
->
getTrackedBuddyPresence
();
ret
.
reserve
(
trackedBuddies
.
size
());
for
(
const
auto
&
tracked_id
:
trackedBuddies
)
{
ret
.
push_back
({
{
DRing
::
Presence
::
BUDDY_KEY
,
tracked_id
.
first
},
{
DRing
::
Presence
::
STATUS_KEY
,
tracked_id
.
second
?
DRing
::
Presence
::
ONLINE_KEY
:
DRing
::
Presence
::
OFFLINE_KEY
}
});
{
DRing
::
Presence
::
BUDDY_KEY
,
tracked_id
.
first
},
{
DRing
::
Presence
::
STATUS_KEY
,
tracked_id
.
second
?
DRing
::
Presence
::
ONLINE_KEY
:
DRing
::
Presence
::
OFFLINE_KEY
}
});
}
}
else
JAMI_ERR
(
"Could not find account %s."
,
accountID
.
c_str
());
...
...
@@ -155,6 +159,9 @@ setSubscriptions(const std::string& accountID, const std::vector<std::string>& u
pres
->
subscribeClient
(
u
,
true
);
}
else
JAMI_ERR
(
"Presence not initialized"
);
}
else
if
(
auto
ringaccount
=
jami
::
Manager
::
instance
().
getAccount
<
jami
::
JamiAccount
>
(
accountID
))
{
for
(
const
auto
&
u
:
uris
)
ringaccount
->
trackBuddyPresence
(
u
,
true
);
}
else
JAMI_ERR
(
"Could not find account %s."
,
accountID
.
c_str
());
}
...
...
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