[geary/wip/714922-multiple-addresses-2] Documentation, code updates



commit e7fc20264e8b1eb072833f4d11efb106397960fe
Author: Jim Nelson <jim yorba org>
Date:   Wed Feb 11 14:52:18 2015 -0800

    Documentation, code updates

 src/client/composer/composer-widget.vala           |    4 +-
 .../conversation-list/conversation-list-store.vala |    2 +-
 src/engine/api/geary-account-information.vala      |    2 +-
 src/engine/rfc822/rfc822-mailbox-address.vala      |   36 ++++++++++++++++++++
 src/engine/rfc822/rfc822-mailbox-addresses.vala    |    7 +++-
 5 files changed, 46 insertions(+), 5 deletions(-)
---
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 2ca88ef..8403ef4 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -2270,7 +2270,7 @@ public class ComposerWidget : Gtk.EventBox {
             account.information.get_primary_mailbox_address());
         from_multiple.append_text(primary_address.to_rfc822_string());
         from_list.add(new FromAddressMap(account, primary_address));
-        if (!set_active && Geary.RFC822.Utils.equal(from,primary_address)) {
+        if (!set_active && Geary.RFC822.Utils.equal(from, primary_address)) {
             from_multiple.set_active(from_list.size - 1);
             set_active = true;
         }
@@ -2294,7 +2294,7 @@ public class ComposerWidget : Gtk.EventBox {
                 from_multiple.append_text(display);
                 from_list.add(new FromAddressMap(account, addresses));
                 
-                if (!set_active && Geary.RFC822.Utils.equal(from,addresses)) {
+                if (!set_active && Geary.RFC822.Utils.equal(from, addresses)) {
                     from_multiple.set_active(from_list.size - 1);
                     set_active = true;
                 }
diff --git a/src/client/conversation-list/conversation-list-store.vala 
b/src/client/conversation-list/conversation-list-store.vala
index 05b6552..9b75e95 100644
--- a/src/client/conversation-list/conversation-list-store.vala
+++ b/src/client/conversation-list/conversation-list-store.vala
@@ -290,7 +290,7 @@ public class ConversationListStore : Gtk.ListStore {
     
     private void set_row(Gtk.TreeIter iter, Geary.App.Conversation conversation, Geary.Email preview) {
         FormattedConversationData conversation_data = new FormattedConversationData(conversation,
-            preview, conversation_monitor.folder, 
+            preview, conversation_monitor.folder,
             conversation_monitor.folder.account.information.get_all_email_addresses());
         
         Gtk.TreePath? path = get_path(iter);
diff --git a/src/engine/api/geary-account-information.vala b/src/engine/api/geary-account-information.vala
index 3d847da..cf5a8dd 100644
--- a/src/engine/api/geary-account-information.vala
+++ b/src/engine/api/geary-account-information.vala
@@ -253,7 +253,7 @@ public class Geary.AccountInformation : BaseObject {
         email = from.email;
         alternate_emails = null;
         if (from.alternate_emails != null) {
-            alternate_emails = new Gee.ArrayList<string>();
+            alternate_emails = new Gee.ArrayList<string>(String.stri_equal);
             foreach (string alternate_email in from.alternate_emails)
                 alternate_emails.add(alternate_email);
         }
diff --git a/src/engine/rfc822/rfc822-mailbox-address.vala b/src/engine/rfc822/rfc822-mailbox-address.vala
index 4478cc9..eae6634 100644
--- a/src/engine/rfc822/rfc822-mailbox-address.vala
+++ b/src/engine/rfc822/rfc822-mailbox-address.vala
@@ -4,13 +4,46 @@
  * (version 2.1 or later).  See the COPYING file in this distribution.
  */
 
+/**
+ * An immutable object containing a representation of an Internet email address.
+ *
+ * See [[https://tools.ietf.org/html/rfc2822#section-3.4]]
+ */
+
 public class Geary.RFC822.MailboxAddress : Geary.MessageData.SearchableMessageData, BaseObject {
     internal delegate string ListToStringDelegate(MailboxAddress address);
     
+    /**
+     * The optional user-friendly name associated with the { link MailboxAddress}.
+     *
+     * For "Dirk Gently <dirk example com>", this would be "Dirk Gently".
+     */
     public string? name { get; private set; }
+    
+    /**
+     * The routing of the message (optional, obsolete).
+     */
     public string? source_route { get; private set; }
+    
+    /**
+     * The mailbox (local-part) portion of the { link MailboxAddress}.
+     *
+     * For "Dirk Gently <dirk example com>", this would be "dirk".
+     */
     public string mailbox { get; private set; }
+    
+    /**
+     * The domain portion of the { link MailboxAddress}.
+     *
+     * For "Dirk Gently <dirk example com>", this would be "example.com".
+     */
     public string domain { get; private set; }
+    
+    /**
+     * The address specification of the { link MailboxAddress}.
+     *
+     * For "Dirk Gently <dirk example com>", this would be "dirk example com".
+     */
     public string address { get; private set; }
     
     public MailboxAddress(string? name, string address) {
@@ -23,6 +56,9 @@ public class Geary.RFC822.MailboxAddress : Geary.MessageData.SearchableMessageDa
         if (atsign > 0) {
             mailbox = address.slice(0, atsign);
             domain = address.slice(atsign + 1, address.length);
+        } else {
+            mailbox = "";
+            domain = "";
         }
     }
     
diff --git a/src/engine/rfc822/rfc822-mailbox-addresses.vala b/src/engine/rfc822/rfc822-mailbox-addresses.vala
index d1b99c5..71da8cc 100644
--- a/src/engine/rfc822/rfc822-mailbox-addresses.vala
+++ b/src/engine/rfc822/rfc822-mailbox-addresses.vala
@@ -74,7 +74,12 @@ public class Geary.RFC822.MailboxAddresses : Geary.MessageData.AbstractMessageDa
         return false;
     }
     
-    
+    /**
+     * Returns the addresses suitable for insertion into an RFC822 message.  RFC822 quoting is
+     * performed if required.
+     *
+     * @see RFC822.to_rfc822_string
+     */
     public string to_rfc822_string() {
         return MailboxAddress.list_to_string(addrs, "", (a) => a.to_rfc822_string());
     }


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