[geary/mjog/composer-context-loading-fixes: 5/14] Geary.RFC822.MessageIDList: Update append methods




commit a28b102315b26560740d32bef72724884af8e7e4
Author: Michael Gratton <mike vee net>
Date:   Wed Aug 12 10:10:20 2020 +1000

    Geary.RFC822.MessageIDList: Update append methods
    
    Add new `append_id` method, rename `append` to `append_list` to
    disambiguate.

 src/engine/rfc822/rfc822-message-data.vala | 15 ++++++++++++---
 src/engine/rfc822/rfc822-message.vala      |  2 +-
 2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/engine/rfc822/rfc822-message-data.vala b/src/engine/rfc822/rfc822-message-data.vala
index ee06727ae..0c13ef5fd 100644
--- a/src/engine/rfc822/rfc822-message-data.vala
+++ b/src/engine/rfc822/rfc822-message-data.vala
@@ -201,10 +201,19 @@ public class Geary.RFC822.MessageIDList :
     }
 
     /**
-     * Returns a new list with the given messages ids appended to this list's.
+     * Returns a new list with the given list appended to this.
      */
-    public MessageIDList append(MessageIDList others) {
-        MessageIDList new_ids = new MessageIDList(this.list);
+    public MessageIDList append_id(MessageID other) {
+        var new_ids = new MessageIDList(this.list);
+        new_ids.list.add(other);
+        return new_ids;
+    }
+
+    /**
+     * Returns a new list with the given list appended to this.
+     */
+    public MessageIDList append_list(MessageIDList others) {
+        var new_ids = new MessageIDList(this.list);
         new_ids.list.add_all(others.list);
         return new_ids;
     }
diff --git a/src/engine/rfc822/rfc822-message.vala b/src/engine/rfc822/rfc822-message.vala
index e995f430b..de33bafe5 100644
--- a/src/engine/rfc822/rfc822-message.vala
+++ b/src/engine/rfc822/rfc822-message.vala
@@ -960,7 +960,7 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
             try {
                 ids = new MessageIDList.from_rfc822_string(header_value);
                 if (existing != null) {
-                    ids = existing.append(ids);
+                    ids = existing.append_list(ids);
                 }
             } catch (Error err) {
                 // Can't simply throw this since we need to be as lax as


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]