* Bug 654509 — Folks master not building
* Bug 652048 — Make nickname writable
* Bug 652425 — Failure codes for removing personas needed in PersonaStoreError
+* Bug 645549 — Add a way to get the individual from a persona
API changes:
* Swf.Persona retains and exposes its libsocialweb Contact
* Add PersonaStoreError.PERMISSION_DENIED and PersonaStoreError.REMOVE_FAILED
* Change the error domain of PersonaStore.remove_persona() from GLib.Error to
Folks.PersonaStoreError
+* Add a Persona.individual property
Overview of changes from libfolks 0.5.1 to libfolks 0.5.2
=========================================================
private void _connect_to_persona (Persona persona)
{
+ persona.individual = this;
+
persona.notify["alias"].connect (this._notify_alias_cb);
persona.notify["avatar"].connect (this._notify_avatar_cb);
persona.notify["presence-message"].connect (this._notify_presence_cb);
}
}
- private void _disconnect_from_persona (Persona persona)
+ private void _disconnect_from_persona (Persona persona,
+ Individual? replacement_individual)
{
persona.notify["alias"].disconnect (this._notify_alias_cb);
persona.notify["avatar"].disconnect (this._notify_avatar_cb);
((GroupDetails) persona).group_changed.disconnect (
this._persona_group_changed_cb);
}
+
+ persona.individual = replacement_individual;
}
private void _update_gender ()
this._stores.unset (store);
}
- this._disconnect_from_persona (p);
+ this._disconnect_from_persona (p, replacement_individual);
iter.remove ();
}
}
*/
public abstract class Folks.Persona : Object
{
+ private weak Individual _individual;
+
/**
* The internal ID used to represent the Persona for linking.
*
public weak PersonaStore store { get; construct; }
/**
+ * The {@link Individual} which contains this Persona.
+ *
+ * This may be `null`, but should only ever be so when the Persona has just
+ * been created, when its {@link PersonaStore} is being destroyed, or when
+ * it's moving between {@link Individual}s.
+ *
+ * @since UNRELEASED
+ */
+ public weak Individual? individual
+ {
+ get
+ {
+ assert (this._individual == null ||
+ this._individual.personas.contains (this));
+
+ return this._individual;
+ }
+
+ internal set
+ {
+ assert (value == null || value.personas.contains (this));
+
+ this._individual = value;
+ }
+ }
+
+ /**
* The names of the properties of this Persona which are linkable.
*
* If a property name is in this list, and the Persona is from a