From 57d847692c1b67110fe48a77308330531d33c449 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 2 Nov 2010 13:37:29 -0500 Subject: smsutil: Get rid of ref_offset in sms_text_prepare The reason for this parameter has ceased to exist quite a while ago. Namely when the API allowed multiple SMS recipients. We prepared a single set of segments and then reset the to address and reference. We no longer allow multiple recipients and none of this is now needed. --- src/smsutil.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/smsutil.c') diff --git a/src/smsutil.c b/src/smsutil.c index bc4f13c9..ff19be39 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -3146,8 +3146,8 @@ static inline GSList *sms_list_append(GSList *l, const struct sms *in) * @use_delivery_reports: value for the Status-Report-Request field * (23.040 3.2.9, 9.2.2.2) */ -GSList *sms_text_prepare(const char *utf8, guint16 ref, - gboolean use_16bit, int *ref_offset, +GSList *sms_text_prepare(const char *to, const char *utf8, guint16 ref, + gboolean use_16bit, gboolean use_delivery_reports) { struct sms template; @@ -3167,6 +3167,7 @@ GSList *sms_text_prepare(const char *utf8, guint16 ref, template.submit.srr = use_delivery_reports; template.submit.mr = 0; template.submit.vp.relative = 0xA7; /* 24 Hours */ + sms_address_from_string(&template.submit.daddr, to); /* UDHI, UDL, UD and DCS actually depend on what we have in the text */ gsm_encoded = convert_utf8_to_gsm(utf8, -1, NULL, &written, 0); @@ -3191,9 +3192,6 @@ GSList *sms_text_prepare(const char *utf8, guint16 ref, template.submit.udhi = FALSE; if (gsm_encoded && (written <= sms_text_capacity_gsm(160, offset))) { - if (ref_offset) - *ref_offset = 0; - template.submit.udl = written + (offset * 8 + 6) / 7; pack_7bit_own_buf(gsm_encoded, written, offset, FALSE, NULL, 0, template.submit.ud + offset); @@ -3203,9 +3201,6 @@ GSList *sms_text_prepare(const char *utf8, guint16 ref, } if (ucs2_encoded && (written <= (140 - offset))) { - if (ref_offset) - *ref_offset = 0; - template.submit.udl = written + offset; memcpy(template.submit.ud + offset, ucs2_encoded, written); @@ -3218,9 +3213,6 @@ GSList *sms_text_prepare(const char *utf8, guint16 ref, if (!offset) offset = 1; - if (ref_offset) - *ref_offset = offset + 2; - if (use_16bit) { template.submit.ud[0] += 6; template.submit.ud[offset] = SMS_IEI_CONCATENATED_16BIT; -- cgit v1.2.3