Commit b5fde051 authored by Kyle Evans's avatar Kyle Evans
Browse files

Delete the message from MMSD after processing


Signed-off-by: Kyle Evans's avatarKyle Evans <kvans32@gmail.com>
parent 94c91a90
Pipeline #62248 passed with stages
in 4 minutes and 13 seconds
...@@ -720,6 +720,47 @@ pur_mm_delete_sms (PurSmsProps *sms_props) ...@@ -720,6 +720,47 @@ pur_mm_delete_sms (PurSmsProps *sms_props)
} }
} }
static void
cb_pur_mmsd_delete_mms(GObject *interface,
GAsyncResult *result,
gpointer *user_data)
{
g_autoptr(GError) error = NULL;
if (g_dbus_proxy_call_finish(G_DBUS_PROXY(interface),
result,
&error)) {
g_debug ("MMS delete finished");
} else {
g_debug ("Couldn't delete MMS - error: %s", error ? error->message : "unknown");
}
}
static void
pur_mmsd_delete_mms(gchar *objectpath)
{
pur_mmsd_data_t *mmsd = pur_mmsd_get_data ();
GDBusProxy *message_proxy =
g_dbus_proxy_new_sync (mmsd->connection,
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
NULL,
"org.ofono.mms",
objectpath,
"org.ofono.mms.Message",
NULL,
NULL);
g_dbus_proxy_call(message_proxy,
"Delete",
NULL,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
(GAsyncReadyCallback)cb_pur_mmsd_delete_mms,
NULL);
}
static void static void
pur_mmsd_receive_message (GVariant *message_t) pur_mmsd_receive_message (GVariant *message_t)
...@@ -840,6 +881,11 @@ pur_mmsd_receive_message (GVariant *message_t) ...@@ -840,6 +881,11 @@ pur_mmsd_receive_message (GVariant *message_t)
} }
g_object_unref(container); g_object_unref(container);
if (!error) {
g_debug ("Delete MMS from MMSD");
pur_mmsd_delete_mms(objectpath);
}
} }
static void static void
......
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