summaryrefslogtreecommitdiffstats
path: root/src/smsutil.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-11-02 13:37:29 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-11-02 14:58:21 -0500
commit57d847692c1b67110fe48a77308330531d33c449 (patch)
tree105dc4e237ed1c20b1a94a0a3da4e068a9d7872d /src/smsutil.c
parente9b41e953fdaeda7f36cf8ef280c7a074cd72efe (diff)
downloadofono-57d847692c1b67110fe48a77308330531d33c449.tar.bz2
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.
Diffstat (limited to 'src/smsutil.c')
-rw-r--r--src/smsutil.c14
1 files changed, 3 insertions, 11 deletions
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;