aboutsummaryrefslogtreecommitdiff
path: root/src/mm-sms-part.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-01 11:17:50 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:59 +0100
commit8c5dd282f51a790302e1ac713f63613a95346675 (patch)
tree875646e41b5935276076df1961cdb9c7dd017658 /src/mm-sms-part.c
parentc29f06f1e5b0e9d7e6857da142bdc1a184f74ffa (diff)
sms-part: new method to check if the part is from a multipart message
Diffstat (limited to 'src/mm-sms-part.c')
-rw-r--r--src/mm-sms-part.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mm-sms-part.c b/src/mm-sms-part.c
index d9b3fe2e..70bdf794 100644
--- a/src/mm-sms-part.c
+++ b/src/mm-sms-part.c
@@ -218,13 +218,15 @@ struct _MMSmsPart {
gchar *smsc;
gchar *timestamp;
gchar *number;
- guint concat_reference;
- guint concat_max;
- guint concat_sequence;
gchar *text;
GByteArray *data;
guint data_coding_scheme;
guint class;
+
+ gboolean should_concat;
+ guint concat_reference;
+ guint concat_max;
+ guint concat_sequence;
};
void
@@ -258,6 +260,12 @@ PART_GET_FUNC (const GByteArray *, data)
PART_GET_FUNC (guint, data_coding_scheme)
PART_GET_FUNC (guint, class)
+gboolean
+mm_sms_part_should_concat (MMSmsPart *self)
+{
+ return self->should_concat;
+}
+
MMSmsPart *
mm_sms_part_new (guint index,
const gchar *hexpdu,
@@ -382,6 +390,7 @@ mm_sms_part_new (guint index,
pdu[offset + 2] > pdu[offset + 1])
break;
+ sms_part->should_concat = TRUE;
sms_part->concat_reference = pdu[offset];
sms_part->concat_max = pdu[offset + 1];
sms_part->concat_sequence = pdu[offset + 2];
@@ -392,6 +401,7 @@ mm_sms_part_new (guint index,
pdu[offset + 3] > pdu[offset + 2])
break;
+ sms_part->should_concat = TRUE;
sms_part->concat_reference = (pdu[offset] << 8) | pdu[offset + 1];
sms_part->concat_max = pdu[offset + 2];
sms_part->concat_sequence = pdu[offset + 3];