Commit c46ccee5 authored by Philip Withnall's avatar Philip Withnall
Browse files

Bug 658576 — Need API to get a FolksIndividual from his ID

Add an IndividualAggregator.look_up_individual() method which currently just
looks up in the map from IDs to individuals. In future, however, this method
will also ensure all properties of that individual have been loaded if the
aggregator has otherwise not lazy-loaded properties. (See: bgo#648805.)

parent a535eed2
Overview of changes from libfolks 0.6.9 to libfolks 0.7.0
Bugs fixed:
• Bug 658576 — Need API to get a FolksIndividual from his ID
API changes:
• Add IndividualAggregator.look_up_individual()
Overview of changes from libfolks 0.6.8 to libfolks 0.6.9
......@@ -2012,4 +2012,33 @@ public class Folks.IndividualAggregator : Object
return (!) new_persona;
* Look up an individual in the aggregator.
* This returns the {@link Individual} with the given `id` if it exists in
* the aggregator, and `null` otherwise.
* In future, when lazy-loading of individuals' properties is added to folks,
* this method guarantees to load all properties of the individual, even if
* the aggregator hasn't lazy-loaded anything else.
* This method is safe to call before {@link IndividualAggregator.prepare} has
* been called, and will call {@link IndividualAggregator.prepare} itself in
* that case.
* @param id ID of the individual to look up
* @return individual with `id`, or `null` if no such individual was found
* @throws GLib.Error from {@link IndividualAggregator.prepare}
public async Individual? look_up_individual (string id) throws GLib.Error
/* Ensure the aggregator's prepared. */
yield this.prepare ();
/* FIXME: When bgo#648805 is fixed, this needs to support lazy-loading. */
return this._individuals.get (id);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment