summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-06-10 18:43:30 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-06-10 18:43:30 -0500
commit5a883d1c760fc3d64bdc87ebba7ef7ed4e3fceea (patch)
treebf3083c9c538bd1860e68dc413bc0e6ff04e0727
parent150c1e753ffe8f632be3cc5fdfb3043a22f82d55 (diff)
downloadofono-5a883d1c760fc3d64bdc87ebba7ef7ed4e3fceea.tar.bz2
atmodem: Register for notifications after CMGL
-rw-r--r--drivers/atmodem/sms.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c
index 22129cf1..9f54cb20 100644
--- a/drivers/atmodem/sms.c
+++ b/drivers/atmodem/sms.c
@@ -487,8 +487,21 @@ static void at_cmgl_done(struct ofono_sms *sms)
{
struct sms_data *data = ofono_sms_get_data(sms);
- if (data->incoming == MT_STORE && data->store == ME_STORE)
+ if (data->incoming == MT_STORE && data->store == ME_STORE) {
at_cmgl_set_cpms(sms, SM_STORE);
+ return;
+ }
+
+ g_at_chat_register(data->chat, "+CMTI:", at_cmti_notify, FALSE,
+ sms, NULL);
+ g_at_chat_register(data->chat, "+CMT:", at_cmt_notify, TRUE,
+ sms, NULL);
+ g_at_chat_register(data->chat, "+CDS:", at_cds_notify, TRUE,
+ sms, NULL);
+
+ /* We treat CMGR just like a notification */
+ g_at_chat_register(data->chat, "+CMGR:", at_cmgr_notify, TRUE,
+ sms, NULL);
}
static void at_cmgl_notify(GAtResult *result, gpointer user_data)
@@ -605,17 +618,6 @@ static void at_sms_initialized(struct ofono_sms *sms)
{
struct sms_data *data = ofono_sms_get_data(sms);
- g_at_chat_register(data->chat, "+CMTI:", at_cmti_notify, FALSE,
- sms, NULL);
- g_at_chat_register(data->chat, "+CMT:", at_cmt_notify, TRUE,
- sms, NULL);
- g_at_chat_register(data->chat, "+CDS:", at_cds_notify, TRUE,
- sms, NULL);
-
- /* We treat CMGR just like a notification */
- g_at_chat_register(data->chat, "+CMGR:", at_cmgr_notify, TRUE,
- sms, NULL);
-
/* Inspect and free the incoming SMS storage */
if (data->incoming == MT_STORE)
at_cmgl_set_cpms(sms, ME_STORE);