diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-08-14 18:01:53 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-08-19 09:47:01 +0200 |
commit | 246a580c1eaa4eb408b4a814c4c6803c4d6fb7bb (patch) | |
tree | e16ac91ddae02874a41710728802e854b4dedeb3 | |
parent | 61a45a1b13567e22457b5cc955162b29543254ec (diff) |
iface-modem-messaging: never add UNKNOWN to the lists of supported storages
-rw-r--r-- | src/mm-iface-modem-messaging.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mm-iface-modem-messaging.c b/src/mm-iface-modem-messaging.c index 143d7ef9..874397e5 100644 --- a/src/mm-iface-modem-messaging.c +++ b/src/mm-iface-modem-messaging.c @@ -1079,6 +1079,21 @@ initialization_context_complete_and_free_if_cancelled (InitializationContext *ct } static void +skip_unknown_storages (GArray *mem) +{ + guint i = mem->len; + + if (!mem) + return; + + /* Remove UNKNOWN from the list of supported storages */ + while (i-- > 0) { + if (g_array_index (mem, MMSmsStorage, i) == MM_SMS_STORAGE_UNKNOWN) + g_array_remove_index (mem, i); + } +} + +static void load_supported_storages_ready (MMIfaceModemMessaging *self, GAsyncResult *res, InitializationContext *ctx) @@ -1103,6 +1118,11 @@ load_supported_storages_ready (MMIfaceModemMessaging *self, GArray *supported_storages; guint i; + /* Never add unknown storages */ + skip_unknown_storages (storage_ctx->supported_mem1); + skip_unknown_storages (storage_ctx->supported_mem2); + skip_unknown_storages (storage_ctx->supported_mem3); + mem1 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem1->data, storage_ctx->supported_mem1->len); mem2 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem2->data, |