From 9fc60ae8675fe81a3c051e5f4de0378ecfd75069 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 18 Aug 2010 14:26:38 -0500 Subject: Flesh out the revise judgement handler to update the list of approvers. --- src/application-service-appstore.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/application-service-appstore.c') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 7040b2a..2d77d28 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -1188,8 +1188,27 @@ approver_destroyed (gpointer pproxy, gpointer pappstore) void approver_revise_judgement (DBusGProxy * proxy, gboolean new_status, gchar * address, DBusGProxy * get_path, gpointer user_data) { + g_return_if_fail(IS_APPLICATION_SERVICE_APPSTORE(user_data)); + g_return_if_fail(address != NULL && address[0] != '\0'); + g_return_if_fail(get_path != NULL); + const gchar * path = dbus_g_proxy_get_path(get_path); + g_return_if_fail(path != NULL && path[0] != '\0'); + ApplicationServiceAppstore * appstore = APPLICATION_SERVICE_APPSTORE(user_data); - appstore = NULL; + + Application * app = find_application(appstore, address, path); + + if (app == NULL) { + g_warning("Unable to update approver status of application (%s:%s) as it was not found", address, path); + return; + } + + if (new_status) { + app->approved_by = g_list_prepend(app->approved_by, proxy); + } else { + app->approved_by = g_list_remove(app->approved_by, proxy); + } + apply_status(app); return; } -- cgit v1.2.3