Commit 4efd3746 authored by Philip Withnall's avatar Philip Withnall
Browse files

telepathy: Tidy up group change notification handling in Tpf.Persona

parent 85e8d88f
......@@ -496,38 +496,32 @@ public class Tpf.Persona : Folks.Persona,
}
/* Note: Only ever called as a result of signals from Telepathy. */
private bool _change_group (string group, bool is_member)
private void _contact_groups_changed (string[] added, string[] removed)
{
var changed = false;
if (is_member)
foreach (var group in added)
{
changed = this._groups.add (group);
}
else
if (this._groups.add (group) == true)
{
changed = this._groups.remove (group);
changed = true;
this.group_changed (group, true);
}
if (changed == true)
{
this.group_changed (group, is_member);
this.notify_property ("groups");
}
return changed;
}
private void _contact_groups_changed (string[] added, string[] removed)
foreach (var group in removed)
{
foreach (var group in added)
if (this._groups.remove (group) == true)
{
this._change_group (group, true);
changed = true;
this.group_changed (group, false);
}
}
foreach (var group in removed)
/* Notify if anything changed. */
if (changed == true)
{
this._change_group (group, false);
this.notify_property ("groups");
}
}
......
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