summaryrefslogtreecommitdiff
path: root/obexd
diff options
context:
space:
mode:
authorChristian Fetzer <christian.fetzer@bmw-carit.de>2013-09-23 11:24:26 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-09-26 15:34:06 +0300
commit0c254a041532435824feb39bacfa184349f79fbd (patch)
tree4dce6f1473f10f8c46058ec61d0e5c2a0f40e92e /obexd
parent0978ffbd6fe4f0402e709b8588899aabab802c6b (diff)
obexd: Add folder property to map_msg_create
Message interfaces are not necessarily created for the current folder, therefore the folder needs to be specified in a parameter. For example, messages can be created for sub folders when using the folder parameter in ListMessages.
Diffstat (limited to 'obexd')
-rw-r--r--obexd/client/map.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/obexd/client/map.c b/obexd/client/map.c
index 9fe872dfa..131b14058 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -809,7 +809,8 @@ static const GDBusPropertyTable map_msg_properties[] = {
{ }
};
-static struct map_msg *map_msg_create(struct map_data *data, const char *handle)
+static struct map_msg *map_msg_create(struct map_data *data, const char *handle,
+ const char *folder)
{
struct map_msg *msg;
@@ -818,7 +819,7 @@ static struct map_msg *map_msg_create(struct map_data *data, const char *handle)
msg->path = g_strdup_printf("%s/message%s",
obc_session_get_path(data->session),
handle);
- msg->folder = g_strdup(obc_session_get_folder(data->session));
+ msg->folder = g_strdup(folder);
if (!g_dbus_register_interface(conn, msg->path, MAP_MSG_INTERFACE,
map_msg_methods, NULL,
@@ -1097,7 +1098,8 @@ static void msg_element(GMarkupParseContext *ctxt, const char *element,
msg = g_hash_table_lookup(data->messages, values[i]);
if (msg == NULL) {
- msg = map_msg_create(data, values[i]);
+ msg = map_msg_create(data, values[i],
+ obc_session_get_folder(data->session));
if (msg == NULL)
return;
}