From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [RFC PATCH 2/2] sms: status report notify
Date: Thu, 10 Jun 2010 10:07:24 -0500 [thread overview]
Message-ID: <201006101007.24947.denkenz@gmail.com> (raw)
In-Reply-To: <1276153545-22260-3-git-send-email-pasi.miettinen@ixonos.com>
[-- Attachment #1: Type: text/plain, Size: 1958 bytes --]
Hi Pasi,
> ---
> include/history.h | 3 ++
> src/sms.c | 61
> ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files
changed, 63
> insertions(+), 1 deletions(-)
>
> diff --git a/include/history.h b/include/history.h
> index 300a4fb..61a0dea 100644
> --- a/include/history.h
> +++ b/include/history.h
> @@ -33,6 +33,9 @@ enum ofono_history_sms_status {
> OFONO_HISTORY_SMS_STATUS_PENDING,
> OFONO_HISTORY_SMS_STATUS_SUBMITTED,
> OFONO_HISTORY_SMS_STATUS_SUBMIT_FAILED,
> + OFONO_HISTORY_SMS_STATUS_DELIVERED,
> + OFONO_HISTORY_SMS_STATUS_DELIVER_FAILED,
Please resubmit the above two lines as a separate patch. I like to keep
public API changes separate.
> + OFONO_HISTORY_SMS_STATUS_ERROR,
Drop this change, lets modify status_report_assembly to do something different.
> };
>
> +static void handle_sms_status_report(struct ofono_sms *sms,
> + const struct sms *incoming)
> +{
> + unsigned int msg_id;
> + struct ofono_modem *modem = __ofono_atom_get_modem(sms->atom);
> +
> + if (incoming->status_report.st == SMS_ST_COMPLETED_RECEIVED) {
> +
> + if (status_report_assembly_report(sms->sr_assembly,
> + incoming, &msg_id) == OFONO_HISTORY_SMS_STATUS_DELIVERED)
> + __ofono_history_sms_send_status(modem, msg_id,
> + time(NULL), OFONO_HISTORY_SMS_STATUS_DELIVERED);
> + } else {
> + status_report_assembly_report(sms->sr_assembly,
> + incoming, &msg_id);
This looks a little ugly, let the status report assembly decide whether the
message was delivered / failed. So something like:
gboolean delivered;
unsigned int message_id;
gboolean update_history;
update_history = status_report_assembly_report(assembly, incoming, &msg_id,
&delivered);
if (update_history)
...
> + __ofono_history_sms_send_status(modem, msg_id, time(NULL),
> + OFONO_HISTORY_SMS_STATUS_DELIVER_FAILED);
Otherwise patch looks good to me.
Regards,
-Denis
next prev parent reply other threads:[~2010-06-10 15:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-10 7:05 SMS status report Pasi Miettinen
2010-06-10 7:05 ` [RFC PATCH 1/2] smsutil: Status Report assembly Pasi Miettinen
2010-06-10 7:05 ` [RFC PATCH 2/2] sms: status report notify Pasi Miettinen
2010-06-10 15:07 ` Denis Kenzior [this message]
2010-06-10 16:14 ` Denis Kenzior
2010-06-10 16:52 ` [RFC PATCH 1/2] smsutil: Status Report assembly Denis Kenzior
2010-06-11 11:35 ` VS: " Miettinen Pasi
2010-06-11 12:23 ` Miettinen Pasi
2010-06-10 14:47 ` SMS status report Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201006101007.24947.denkenz@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox