diff --git a/obexd/plugins/mas.c b/obexd/plugins/mas.c
index 57d9611..1c9199d 100644
--- a/obexd/plugins/mas.c
+++ b/obexd/plugins/mas.c
/* 1024 is the default when there was no MaxListCount sent */
uint16_t max = 1024;
uint16_t offset = 0;
+ /* If MAP client does not specify the subject length,
+ then subject_len = 0 and subject should be sent unaltered. */
+ uint8_t subject_len = 0;
DBG("");
g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT, &max);
g_obex_apparam_get_uint16(mas->inparams, MAP_AP_STARTOFFSET, &offset);
+ g_obex_apparam_get_uint8(mas->inparams, MAP_AP_SUBJECTLENGTH,
+ &subject_len);
g_obex_apparam_get_uint32(mas->inparams, MAP_AP_PARAMETERMASK,
&filter.parameter_mask);
&filter.priority);
*err = messages_get_messages_listing(mas->backend_data, name, max,
- offset, &filter,
+ offset, subject_len, &filter,
get_messages_listing_cb, mas);
mas->buffer = g_string_new("");
diff --git a/obexd/plugins/messages-dummy.c b/obexd/plugins/messages-dummy.c
index 833c31c..a47f143 100644
--- a/obexd/plugins/messages-dummy.c
+++ b/obexd/plugins/messages-dummy.c
int messages_get_messages_listing(void *session, const char *name,
uint16_t max, uint16_t offset,
+ uint8_t subject_len,
const struct messages_filter *filter,
messages_get_messages_listing_cb callback,
void *user_data)
diff --git a/obexd/plugins/messages-tracker.c b/obexd/plugins/messages-tracker.c
index fb45210..92c1767 100644
--- a/obexd/plugins/messages-tracker.c
+++ b/obexd/plugins/messages-tracker.c
return 0;
}
-int messages_get_messages_listing(void *session,
- const char *name,
+int messages_get_messages_listing(void *session, const char *name,
uint16_t max, uint16_t offset,
+ uint8_t subject_len,
const struct messages_filter *filter,
messages_get_messages_listing_cb callback,
void *user_data)
diff --git a/obexd/plugins/messages.h b/obexd/plugins/messages.h
index beca3a8..669f7c2 100644
--- a/obexd/plugins/messages.h
+++ b/obexd/plugins/messages.h
* name: Optional subdirectory name.
* max: Maximum number of entries to retrieve.
* offset: Offset of the first entry.
+ * subject_len: Maximum string length of the "subject" parameter in the entries.
* filter: Filter to apply on returned message listing.
* size: Total size of listing to be returned.
* newmsg: Indicates presence of unread messages.
int messages_get_messages_listing(void *session, const char *name,
uint16_t max, uint16_t offset,
+ uint8_t subject_len,
const struct messages_filter *filter,
messages_get_messages_listing_cb callback,
void *user_data);