Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
folks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
85
Issues
85
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
folks
Commits
b8c02c39
Commit
b8c02c39
authored
Oct 03, 2012
by
Jeremy Whiting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
telepathy: Implement set_persona_stores backend method.
parent
7fc302f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
1 deletion
+48
-1
backends/telepathy/tp-backend.vala
backends/telepathy/tp-backend.vala
+48
-1
No files found.
backends/telepathy/tp-backend.vala
View file @
b8c02c39
...
...
@@ -36,6 +36,7 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
private
bool
_is_prepared
=
false
;
private
bool
_prepare_pending
=
false
;
/* used by unprepare() too */
private
bool
_is_quiescent
=
false
;
private
Set
<
string
>?
_storeids
=
null
;
/**
* {@inheritDoc}
...
...
@@ -77,7 +78,46 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
*/
public
override
void
set_persona_stores
(
Set
<
string
>?
storeids
)
{
this
.
_storeids
=
storeids
;
bool
added_stores
=
false
;
PersonaStore
[]
removed_stores
=
{};
/* First handle adding any missing persona stores. */
GLib
.
List
<
unowned
Account
>
accounts
=
this
.
_account_manager
.
get_valid_accounts
();
foreach
(
Account
account
in
accounts
)
{
string
id
=
account
.
get_object_path
();
if
(
this
.
persona_stores
.
has_key
(
id
)
==
false
&&
id
in
storeids
)
{
var
store
=
Tpf
.
PersonaStore
.
dup_for_account
(
account
);
this
.
_add_store
(
store
,
false
);
added_stores
=
true
;
}
}
foreach
(
PersonaStore
store
in
this
.
persona_stores
.
values
)
{
if
(!
storeids
.
contains
(
store
.
id
))
{
removed_stores
+=
store
;
}
}
foreach
(
PersonaStore
store
in
removed_stores
)
{
this
.
_remove_store
((
Tpf
.
PersonaStore
)
store
,
false
);
}
/* Finally, if anything changed, emit the persona-stores notification. */
if
(
added_stores
||
removed_stores
.
length
>
0
)
{
this
.
notify_property
(
"persona-stores"
);
}
}
/**
* {@inheritDoc}
...
...
@@ -134,7 +174,7 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
this
.
_account_validity_changed_cb
);
GLib
.
List
<
unowned
Account
>
accounts
=
this
.
_account_manager
.
get_valid_accounts
();
this
.
_account_manager
.
get_valid_accounts
();
foreach
(
Account
account
in
accounts
)
{
this
.
_account_enabled_cb
(
account
);
...
...
@@ -199,6 +239,13 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
return
;
}
/* Ignore if this account's object path isn't in our storeids */
if
(
this
.
_storeids
!=
null
&&
(
account
.
get_object_path
()
in
this
.
_storeids
)
==
false
)
{
return
;
}
var
store
=
Tpf
.
PersonaStore
.
dup_for_account
(
account
);
this
.
_add_store
(
store
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment