Commit f516257d authored by Xavier Claessens's avatar Xavier Claessens
Browse files

TpfPersona: throw PropertyError when an error occure changing group membership

https://bugzilla.gnome.org/show_bug.cgi?id=630822
parent d701c9f3
......@@ -1040,14 +1040,27 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
internal async void _change_group_membership (Folks.Persona persona,
string group, bool is_member)
string group, bool is_member) throws Folks.PropertyError
{
var tp_persona = (Tpf.Persona) persona;
if (is_member)
tp_persona.contact.add_to_group_async (group);
else
tp_persona.contact.remove_from_group_async (group);
try
{
if (is_member)
{
yield tp_persona.contact.add_to_group_async (group);
}
else
{
yield tp_persona.contact.remove_from_group_async (group);
}
}
catch (GLib.Error e)
{
/* Translators: the parameter is an error message. */
throw new PropertyError.UNKNOWN_ERROR (
_("Failed to change group membership: %s"), e.message);
}
}
/**
......
......@@ -417,6 +417,7 @@ public class Tpf.Persona : Folks.Persona,
* See {@link Folks.GroupDetails.change_group}.
*/
public async void change_group (string group, bool is_member)
throws Folks.PropertyError
{
if (this._change_group (group, is_member))
{
......
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