Diff between cb4a4de99c5c9472b60b5ca32b532f480948ced4 and ff52e50288d251c9dd5f1b124511cce8e569db3c

Changed Files

File Additions Deletions Status
doc/obex-api.txt +7 -0 modified
obexd/client/map.c +22 -0 modified

Full Patch

diff --git a/doc/obex-api.txt b/doc/obex-api.txt
index 41c40a7..10534e5 100644
--- a/doc/obex-api.txt
+++ b/doc/obex-api.txt
@@ -587,6 +587,13 @@ Methods		void SetFolder(string name)
 
 					Message size in bytes
 
+				boolean Text:
+
+					Message text flag
+
+					Specifies whether message has textual
+					content or is binary only
+
 				string Status:
 
 					Message reception status
diff --git a/obexd/client/map.c b/obexd/client/map.c
index a51aa5e..d32d6ac 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -99,6 +99,7 @@ struct map_data {
 #define MAP_MSG_FLAG_READ	0x02
 #define MAP_MSG_FLAG_SENT	0x04
 #define MAP_MSG_FLAG_PROTECTED	0x08
+#define MAP_MSG_FLAG_TEXT	0x10
 
 struct map_msg {
 	struct map_data *data;
@@ -629,6 +630,12 @@ static gboolean get_protected(const GDBusPropertyTable *property,
 	return get_flag(property, iter, MAP_MSG_FLAG_PROTECTED, data);
 }
 
+static gboolean get_text(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	return get_flag(property, iter, MAP_MSG_FLAG_TEXT, data);
+}
+
 static void set_status(const GDBusPropertyTable *property,
 			DBusMessageIter *iter, GDBusPendingPropertySet id,
 			uint8_t status, void *data)
@@ -712,6 +719,7 @@ static const GDBusPropertyTable map_msg_properties[] = {
 						recipient_address_exists },
 	{ "Type", "s", get_type, NULL, type_exists },
 	{ "Size", "t", get_size },
+	{ "Text", "b", get_text },
 	{ "Priority", "b", get_priority },
 	{ "Read", "b", get_read, set_read },
 	{ "Sent", "b", get_sent },
@@ -817,6 +825,19 @@ static void parse_size(struct map_msg *msg, const char *value,
 	obex_dbus_dict_append(iter, "Size", DBUS_TYPE_UINT64, &msg->size);
 }
 
+static void parse_text(struct map_msg *msg, const char *value,
+							DBusMessageIter *iter)
+{
+	gboolean flag = strcasecmp(value, "no") != 0;
+
+	if (flag)
+		msg->flags |= MAP_MSG_FLAG_TEXT;
+	else
+		msg->flags &= ~MAP_MSG_FLAG_TEXT;
+
+	obex_dbus_dict_append(iter, "Text", DBUS_TYPE_BOOLEAN, &flag);
+}
+
 static void parse_status(struct map_msg *msg, const char *value,
 							DBusMessageIter *iter)
 {
@@ -891,6 +912,7 @@ static struct map_msg_parser {
 		{ "recipient_addressing", parse_recipient_address },
 		{ "type", parse_type },
 		{ "size", parse_size },
+		{ "text", parse_text },
 		{ "reception_status", parse_status },
 		{ "priority", parse_priority },
 		{ "read", parse_read },