sms: Fix to find SMS entry posted by STK
authorPhilippe Nunes <philippe.nunes@linux.intel.com>
Thu, 30 Aug 2012 16:24:07 +0000 (18:24 +0200)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 12 Sep 2012 03:33:43 +0000 (22:33 -0500)
SMS initiated by proactive command are not exposed on D-BUS.
Therefore, there is no message associated with the entry created from
STK.

src/sms.c

index acfc39b..743f725 100644 (file)
--- a/src/sms.c
+++ b/src/sms.c
@@ -2114,16 +2114,15 @@ int __ofono_sms_txq_set_submit_notify(struct ofono_sms *sms,
                                        void *data,
                                        ofono_destroy_func destroy)
 {
-       struct message *m;
+       GList *l;
        struct tx_queue_entry *entry;
 
-       m = g_hash_table_lookup(sms->messages, uuid);
-       if (m == NULL)
+       l = g_queue_find_custom(sms->txq, uuid, entry_compare_by_uuid);
+
+       if (l == NULL)
                return -ENOENT;
 
-       entry = message_get_data(m);
-       if (entry == NULL)
-               return -ENOTSUP;
+       entry = l->data;
 
        tx_queue_entry_set_submit_notify(entry, cb, data, destroy);