Add store protocol to the data obtained in DBUS GetUnreadMessages
[modest] / libmodest-dbus-client / src / libmodest-dbus-client.c
index 0b62155..f7faf9e 100644 (file)
@@ -400,6 +400,7 @@ modest_account_hits_free (ModestAccountHits *account_hits)
 {
        g_free (account_hits->account_id);
        g_free (account_hits->account_name);
+       g_free (account_hits->store_protocol);
        modest_account_hits_hits_list_free (account_hits->hits);
        g_slice_free (ModestAccountHits, account_hits);
 }
@@ -670,7 +671,7 @@ modest_dbus_message_iter_get_unread_messages_hit (DBusMessageIter *parent)
        hit->timestamp = _dbus_iter_get_int64 (&child); 
 
        res = dbus_message_iter_next (&child);
-       if (res == TRUE) {
+       if (res == FALSE) {
                error = TRUE;
                goto out;
        }       
@@ -686,7 +687,7 @@ modest_dbus_message_iter_get_unread_messages_hit (DBusMessageIter *parent)
        hit->subject = _dbus_iter_get_string_or_null (&child);
 
        res = dbus_message_iter_next (&child);
-       if (res == FALSE) {
+       if (res == TRUE) {
                error = TRUE;
                goto out;
        }
@@ -986,6 +987,22 @@ modest_dbus_message_iter_get_account_hits (DBusMessageIter *parent)
                goto out;
        }
 
+       /* store protocol */
+       arg_type = dbus_message_iter_get_arg_type (&child);
+
+       if (arg_type != DBUS_TYPE_STRING) {
+               error = TRUE;
+               goto out;
+       }
+
+       account_hits->store_protocol = _dbus_iter_get_string_or_null (&child);
+
+       res = dbus_message_iter_next (&child);
+       if (res == FALSE) {
+               error = TRUE;
+               goto out;
+       }
+
        /* list of hits  */
        dbus_message_iter_recurse (&child, &traverse);
        account_hits->hits = NULL;