From 1f3dfc9a9e236015587f73e97c3c619f1064c1e6 Mon Sep 17 00:00:00 2001 From: Simon Redman Date: Sat, 20 Jul 2019 22:35:53 +0200 Subject: [PATCH] Update packet documentation --- plugins/sms/smsplugin.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/plugins/sms/smsplugin.h b/plugins/sms/smsplugin.h index d6d47fccd..5cfbe33e8 100644 --- a/plugins/sms/smsplugin.h +++ b/plugins/sms/smsplugin.h @@ -37,21 +37,44 @@ * The body should contain the key "messages" mapping to an array of messages * * For example: - * { "messages" : [ + * { + * "version": 2 // This is the second version of this packet type and + * // version 1 packets (which did not carry this flag) + * // are incompatible with the new format + * "messages" : [ * { "event" : 1, // 32-bit field containing a bitwise-or of event flags * // See constants declared in SMSHelper.Message for defined * // values and explanations * "body" : "Hello", // Text message body - * "address" : "2021234567", // Sending or receiving address of the message + * "addresses": > // List of Address objects, one for each participant of the conversation + * // The user's Address is excluded so: + * // If this is a single-target messsage, there will only be one + * // Address (the other party) + * // If this is an incoming multi-target message, the first Address is the + * // sender and all other addresses are other parties to the conversation + * // If this is an outgoing multi-target message, the sender is implicit + * // (the user's phone number) and all Addresses are recipients * "date" : "1518846484880", // Timestamp of the message * "type" : "2", // Compare with Android's * // Telephony.TextBasedSmsColumns.MESSAGE_TYPE_* - * "thread_id" : "132" // Thread to which the message belongs + * "thread_id" : 132 // Thread to which the message belongs * "read" : true // Boolean representing whether a message is read or unread * }, * { ... }, * ... * ] + * + * The following optional fields of a message object may be defined + * "sub_id": // Android's subscriber ID, which is basically used to determine which SIM card the message + * // belongs to. This is mostly useful when attempting to reply to an SMS with the correct + * // SIM card using PACKET_TYPE_SMS_REQUEST. + * // If this value is not defined or if it does not match a valid subscriber_id known by + * // Android, we will use whatever subscriber ID Android gives us as the default + * + * An Address object looks like: + * { + * "address": // Address (phone number, email address, etc.) of this object + * } */ #define PACKET_TYPE_SMS_MESSAGES QStringLiteral("kdeconnect.sms.messages")