Commit e5f873bc authored by Jeremy Whiting's avatar Jeremy Whiting
Browse files

Prefer earlier alphabetical uid persona when two personas from the same persona store.

Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=681346
parent 3a928bc9
......@@ -2,6 +2,7 @@ Overview of changes from libfolks 0.7.3 to libfolks 0.7.4
=========================================================
Bugs fixed:
• Bug 681346 — Individual id can be inconsistent
Overview of changes from libfolks 0.7.2 to libfolks 0.7.3
=========================================================
......
......@@ -2162,6 +2162,7 @@ public class Folks.Individual : Object,
* 1. store.is-primary-store
* 2. store.trust-level
* 3. store.id (alphabetically)
* 4. persona.uid (alphabetically)
*
* Note that this heuristic shouldn't be changed without careful thought,
* since stored references to IDs may be broken by the change.
......@@ -2190,7 +2191,13 @@ public class Folks.Individual : Object,
persona.store.is_primary_store &&
_chosen_persona.store.trust_level ==
persona.store.trust_level &&
_chosen_persona.store.id > persona.store.id)
_chosen_persona.store.id > persona.store.id) ||
(_chosen_persona.store.is_primary_store ==
persona.store.is_primary_store &&
_chosen_persona.store.trust_level ==
persona.store.trust_level &&
_chosen_persona.store.id == persona.store.id &&
_chosen_persona.uid > persona.uid)
)
{
chosen_persona = persona;
......
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