From ed623f662849a9b784280bcb7e6500b962a7e041 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 16 Jun 2014 16:22:51 +0200 Subject: [PATCH] iface-modem-messaging: don't skip MT storage when reading if it's the only one --- src/mm-iface-modem-messaging.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mm-iface-modem-messaging.c b/src/mm-iface-modem-messaging.c index 11018624..06770f39 100644 --- a/src/mm-iface-modem-messaging.c +++ b/src/mm-iface-modem-messaging.c @@ -808,10 +808,12 @@ load_initial_sms_parts_from_storages (EnablingContext *ctx) if (!storage_ctx->supported_mem1 || ctx->mem1_storage_index >= storage_ctx->supported_mem1->len) all_loaded = TRUE; - /* We'll skip the 'MT' storage, as that is a combination of 'SM' and 'ME' */ - else if (g_array_index (storage_ctx->supported_mem1, - MMSmsStorage, - ctx->mem1_storage_index) == MM_SMS_STORAGE_MT) { + /* We'll skip the 'MT' storage, as that is a combination of 'SM' and 'ME'; but only if + * this is not the only one in the list. */ + else if ((g_array_index (storage_ctx->supported_mem1, + MMSmsStorage, + ctx->mem1_storage_index) == MM_SMS_STORAGE_MT) && + (storage_ctx->supported_mem1->len > 1)) { ctx->mem1_storage_index++; if (ctx->mem1_storage_index >= storage_ctx->supported_mem1->len) all_loaded = TRUE;