aboutsummaryrefslogtreecommitdiff
path: root/src/mm-sms-part.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-09-11 14:40:42 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-09-14 07:05:24 +0200
commit7faa48ea9490c0af563d3bb8426a1e2d9bf83f82 (patch)
tree23a8e6b85e6eecd9135da3b3b3635e8055b90baf /src/mm-sms-part.c
parent5b6e080472952d1c97568d9925aae268677623a6 (diff)
api: new `PduType' property in the SMS interface
It will help deciding the type of message.
Diffstat (limited to 'src/mm-sms-part.c')
-rw-r--r--src/mm-sms-part.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mm-sms-part.c b/src/mm-sms-part.c
index f0b36ce4..541810c6 100644
--- a/src/mm-sms-part.c
+++ b/src/mm-sms-part.c
@@ -21,6 +21,7 @@
#include <ModemManager.h>
#include <mm-errors-types.h>
+#include <libmm-common.h>
#include "mm-sms-part.h"
#include "mm-charsets.h"
@@ -260,6 +261,7 @@ sms_decode_text (const guint8 *text, int len, MMSmsEncoding encoding, int bit_of
struct _MMSmsPart {
guint index;
+ MMSmsPduType pdu_type;
gchar *smsc;
gchar *timestamp;
gchar *number;
@@ -323,6 +325,8 @@ mm_sms_part_free (MMSmsPart *self)
PART_GET_FUNC (guint, index)
PART_SET_FUNC (guint, index)
+PART_GET_FUNC (MMSmsPduType, pdu_type)
+PART_SET_FUNC (MMSmsPduType, pdu_type)
PART_GET_FUNC (const gchar *, smsc)
PART_SET_TAKE_STR_FUNC (smsc)
PART_GET_FUNC (const gchar *, number)
@@ -383,12 +387,14 @@ mm_sms_part_should_concat (MMSmsPart *self)
}
MMSmsPart *
-mm_sms_part_new (guint index)
+mm_sms_part_new (guint index,
+ MMSmsPduType pdu_type)
{
MMSmsPart *sms_part;
sms_part = g_slice_new0 (MMSmsPart);
sms_part->index = index;
+ sms_part->pdu_type = pdu_type;
return sms_part;
}
@@ -500,7 +506,7 @@ mm_sms_part_new_from_binary_pdu (guint index,
}
/* Create the new MMSmsPart */
- sms_part = mm_sms_part_new (index);
+ sms_part = mm_sms_part_new (index, MM_SMS_PDU_TYPE_SUBMIT);
mm_sms_part_take_smsc (sms_part,
sms_decode_address (&pdu[1], 2 * (pdu[0] - 1)));
mm_sms_part_take_number (sms_part,