summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md37
-rw-r--r--binding/bluetooth-map-api.c6
2 files changed, 24 insertions, 19 deletions
diff --git a/README.md b/README.md
index d51e00e..8aa21e0 100644
--- a/README.md
+++ b/README.md
@@ -79,23 +79,26 @@ Response which the message handle as the key and includes its properties:
<pre>
{
"response": {
- "message288230376151711769": {
- "folder": "/telecom/msg/INBOX",
- "subject": "Meet at Victor 23 at 6p?",
- "timestamp": "20190614T093341",
- "sender": "",
- "senderaddress": "+13605551212",
- "recipient": "",
- "recipientaddress": "",
- "type": "sms-gsm",
- "size": 24,
- "status": "complete",
- "priority": false,
- "read": false,
- "sent": false,
- "protected": false
- },
- ...
+ "messages": {
+ "message288230376151711769": {
+ "folder": "/telecom/msg/INBOX",
+ "subject": "Meet at Victor 23 at 6p?",
+ "timestamp": "20190614T093341",
+ "sender": "",
+ "senderaddress": "+13605551212",
+ "recipient": "",
+ "recipientaddress": "",
+ "type": "sms-gsm",
+ "size": 24,
+ "status": "complete",
+ "priority": false,
+ "read": false,
+ "sent": false,
+ "protected": false
+ },
+ ...
+ }
+ }
},
</pre>
diff --git a/binding/bluetooth-map-api.c b/binding/bluetooth-map-api.c
index e09b120..98cd360 100644
--- a/binding/bluetooth-map-api.c
+++ b/binding/bluetooth-map-api.c
@@ -467,7 +467,7 @@ static void list_msgs(afb_req_t request)
GVariantIter *iter = NULL, *iter2 = NULL;
const char *folder;
const gchar *path = NULL;
- json_object *jresp;
+ json_object *jresp, *jmessage;
gchar *session;
folder = afb_req_value(request, "folder");
@@ -496,6 +496,8 @@ static void list_msgs(afb_req_t request)
}
jresp = json_object_new_object();
+ jmessage = json_object_new_object();
+ json_object_object_add(jresp, "messages", jmessage);
g_variant_get(reply, "(a{oa{sv}})", &iter);
while (g_variant_iter_loop(iter, "{oa{sv}}", &path, &iter2)) {
@@ -517,7 +519,7 @@ static void list_msgs(afb_req_t request)
g_clear_error(&error);
}
}
- json_object_object_add(jresp, path + strlen(session) + 1, msg);
+ json_object_object_add(jmessage, path + strlen(session) + 1, msg);
}
afb_req_success_f(request, jresp, "Bluetooth MAP folder listing");