From 94e0736cfd3230e0c379628a3c54e17360933166 Mon Sep 17 00:00:00 2001 From: Michael Gratton Date: Wed, 30 Oct 2019 14:17:44 +1100 Subject: [PATCH] Update Geary.Outbox.EmailIdentifier variant type marker Use 'o' instead of 's' to avoid confusion with search ids. Add test. --- src/engine/imap-engine/imap-engine-generic-account.vala | 2 +- src/engine/outbox/outbox-email-identifier.vala | 2 +- test/engine/imap-engine/imap-engine-generic-account-test.vala | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala b/src/engine/imap-engine/imap-engine-generic-account.vala index c7a28c75..bddfe1f8 100644 --- a/src/engine/imap-engine/imap-engine-generic-account.vala +++ b/src/engine/imap-engine/imap-engine-generic-account.vala @@ -416,7 +416,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account { char type = (char) serialised.get_child_value(0).get_byte(); if (type == 'i') return new ImapDB.EmailIdentifier.from_variant(serialised); - if (type == 's') + if (type == 'o') return new Outbox.EmailIdentifier.from_variant(serialised); throw new EngineError.BAD_PARAMETERS("Unknown serialised type: %c", type); diff --git a/src/engine/outbox/outbox-email-identifier.vala b/src/engine/outbox/outbox-email-identifier.vala index f3b93a62..cf12b751 100644 --- a/src/engine/outbox/outbox-email-identifier.vala +++ b/src/engine/outbox/outbox-email-identifier.vala @@ -45,7 +45,7 @@ private class Geary.Outbox.EmailIdentifier : Geary.EmailIdentifier { // Return a tuple to satisfy the API contract, add an 's' to // inform GenericAccount that it's an SMTP id. return new GLib.Variant.tuple(new Variant[] { - new GLib.Variant.byte('s'), + new GLib.Variant.byte('o'), new GLib.Variant.int64(this.message_id), new GLib.Variant.int64(this.ordering) }); diff --git a/test/engine/imap-engine/imap-engine-generic-account-test.vala b/test/engine/imap-engine/imap-engine-generic-account-test.vala index 73f9793b..54829e15 100644 --- a/test/engine/imap-engine/imap-engine-generic-account-test.vala +++ b/test/engine/imap-engine/imap-engine-generic-account-test.vala @@ -88,6 +88,9 @@ public class Geary.ImapEngine.GenericAccountTest : TestCase { assert_non_null( test_article.to_email_identifier(new GLib.Variant("(yxx)", 'i', 1, 2)) ); + assert_non_null( + test_article.to_email_identifier(new GLib.Variant("(yxx)", 'o', 1, 2)) + ); } }