summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Dasmohapatra <vivek@collabora.co.uk>2011-03-30 18:11:01 +0100
committerVivek Dasmohapatra <vivek@collabora.co.uk>2011-04-05 14:19:11 +0100
commit3f7e0ca90a52edf6141f9beabf5b62d082d898e4 (patch)
tree90dc8a434a71cc42e6b192ab5d413e56997533d1
parent02c76ce59f1bb8ef11630cd5f0c21d3cf79c9246 (diff)
downloadtelepathy-mission-control-3f7e0ca90a52edf6141f9beabf5b62d082d898e4.tar.gz
Extend message context struct + allocator & free func so we can allow retries
-rw-r--r--src/mcd-dispatcher.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 893752b6..ed16addc 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -2092,6 +2092,9 @@ _mcd_dispatcher_get_client_registry (McdDispatcher *self)
/* org.freedesktop.Telepathy.ChannelDispatcher.Messages */
typedef struct
{
+ McdDispatcher *dispatcher;
+ gchar *account_path;
+ gchar *target_id;
GPtrArray *payload;
guint flags;
guint tries;
@@ -2100,9 +2103,11 @@ typedef struct
} MessageContext;
static MessageContext *
-message_context_new (const GPtrArray *payload,
- guint flags,
- DBusGMethodInvocation *dbus_context)
+message_context_new (McdDispatcher *dispatcher,
+ const gchar *account_path,
+ const gchar *target_id,
+ const GPtrArray *payload,
+ guint flags)
{
guint i;
const guint size = payload->len;
@@ -2118,9 +2123,12 @@ message_context_new (const GPtrArray *payload,
g_ptr_array_add (msg_copy, _mcd_deepcopy_asv (part));
}
+ context->dispatcher = g_object_ref (dispatcher);
+ context->account_path = g_strdup (account_path);
+ context->target_id = g_strdup (target_id);
context->payload = msg_copy;
context->flags = flags;
- context->dbus_context = dbus_context;
+ context->dbus_context = NULL;
return context;
}
@@ -2131,6 +2139,8 @@ message_context_free (gpointer ctx)
MessageContext *context = ctx;
tp_clear_pointer (&context->payload, g_ptr_array_unref);
+ tp_clear_pointer (&context->account_path, g_free);
+ tp_clear_pointer (&context->target_id, g_free);
if (context->dbus_context != NULL)
{
@@ -2142,6 +2152,8 @@ message_context_free (gpointer ctx)
g_error_free (error);
}
+ tp_clear_pointer (&context->dispatcher, g_object_unref);
+
g_slice_free (MessageContext, context);
}