[geary/mjog/special-type-cleanup: 3/6] Geary.SpecialFolderType: Rename SPAM to JUNK



commit 32acff51b8b3f4bf1ff5bda1dc919c37e08551bc
Author: Michael Gratton <mike vee net>
Date:   Fri Mar 27 17:55:52 2020 +1100

    Geary.SpecialFolderType: Rename SPAM to JUNK
    
    The latter is more general as it can also be used for malware, etc,
    and less evocative of processed pig products.

 src/client/application/application-main-window.vala         | 10 ++++------
 src/client/folder-list/folder-list-folder-entry.vala        |  6 +++---
 src/client/plugin/special-folders/special-folders.vala      |  4 ++--
 src/client/util/util-i18n.vala                              |  4 ++--
 src/engine/api/geary-account-information.vala               |  8 ++++----
 src/engine/api/geary-account.vala                           |  2 +-
 src/engine/api/geary-special-folder-type.vala               |  2 +-
 src/engine/app/app-conversation-monitor.vala                |  2 +-
 src/engine/app/app-search-folder.vala                       |  2 +-
 src/engine/imap-engine/gmail/imap-engine-gmail-account.vala |  4 ++--
 src/engine/imap-engine/imap-engine-generic-account.vala     | 10 +++++-----
 src/engine/imap/command/imap-create-command.vala            |  2 +-
 src/engine/imap/response/imap-mailbox-attributes.vala       |  4 ++--
 test/engine/common/common-contact-harvester-test.vala       |  2 +-
 14 files changed, 30 insertions(+), 32 deletions(-)
---
diff --git a/src/client/application/application-main-window.vala 
b/src/client/application/application-main-window.vala
index d8ff505f..7f149719 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -2236,8 +2236,8 @@ public class Application.MainWindow :
         get_window_action(ACTION_MARK_AS_STARRED).set_enabled(unstarred_selected);
         get_window_action(ACTION_MARK_AS_UNSTARRED).set_enabled(starred_selected);
 
-        // If we're in Drafts/Outbox, we also shouldn't set a message as SPAM.
-        bool in_spam_folder = selected_folder.special_folder_type == Geary.SpecialFolderType.SPAM;
+        // If we're in Drafts/Outbox, we also shouldn't set a message as junk
+        bool in_spam_folder = (selected_folder.special_folder_type == JUNK);
         get_window_action(ACTION_TOGGLE_SPAM).set_enabled(!in_spam_folder &&
             selected_folder.special_folder_type != Geary.SpecialFolderType.DRAFTS &&
             selected_folder.special_folder_type != Geary.SpecialFolderType.OUTBOX);
@@ -2343,8 +2343,8 @@ public class Application.MainWindow :
         Geary.Folder? source = this.selected_folder;
         if (source != null) {
             Geary.SpecialFolderType destination =
-                (source.special_folder_type != SPAM)
-                ? Geary.SpecialFolderType.SPAM
+                (source.special_folder_type != JUNK)
+                ? Geary.SpecialFolderType.JUNK
                 : Geary.SpecialFolderType.INBOX;
             this.controller.move_conversations_special.begin(
                 source,
@@ -2457,8 +2457,6 @@ public class Application.MainWindow :
         }
     }
 
-    // Individual conversation email view action callbacks
-
     private void on_email_loaded(ConversationListBox view,
                                  Geary.Email loaded) {
         this.controller.email_loaded(
diff --git a/src/client/folder-list/folder-list-folder-entry.vala 
b/src/client/folder-list/folder-list-folder-entry.vala
index 26fb8697..d26577d6 100644
--- a/src/client/folder-list/folder-list-folder-entry.vala
+++ b/src/client/folder-list/folder-list-folder-entry.vala
@@ -67,7 +67,7 @@ public class FolderList.FolderEntry : FolderList.AbstractFolderEntry, Sidebar.In
             case Geary.SpecialFolderType.ARCHIVE:
                 return "mail-archive-symbolic";
 
-            case Geary.SpecialFolderType.SPAM:
+            case Geary.SpecialFolderType.JUNK:
                 return "dialog-warning-symbolic";
 
             case Geary.SpecialFolderType.TRASH:
@@ -125,9 +125,9 @@ public class FolderList.FolderEntry : FolderList.AbstractFolderEntry, Sidebar.In
             case Geary.SpecialFolderType.OUTBOX:
                 return folder.properties.email_total;
 
-            // only show counts for Inbox, Spam, and user folders
+            // only show counts for Inbox, Junk, and user folders
             case Geary.SpecialFolderType.INBOX:
-            case Geary.SpecialFolderType.SPAM:
+            case Geary.SpecialFolderType.JUNK:
             case Geary.SpecialFolderType.NONE:
                 return folder.properties.email_unread;
 
diff --git a/src/client/plugin/special-folders/special-folders.vala 
b/src/client/plugin/special-folders/special-folders.vala
index ee32714d..aed4fc18 100644
--- a/src/client/plugin/special-folders/special-folders.vala
+++ b/src/client/plugin/special-folders/special-folders.vala
@@ -85,7 +85,7 @@ public class Plugin.SpecialFolders :
             );
             break;
 
-        case SPAM:
+        case JUNK:
             this.folders.add_folder_info_bar(
                 target, get_folder_info_bar(target), PRIORITY
             );
@@ -133,7 +133,7 @@ public class Plugin.SpecialFolders :
     private InfoBar get_folder_info_bar(Folder target) {
         var bar = this.info_bars.get(target);
         if (bar == null) {
-            bar = new InfoBar(target.folder_type.get_display_name());
+            bar = new InfoBar(target.display_name);
             bar.primary_button = new Button(
                 // Translators: Info bar button label for emptying
                 // trash/spam folders
diff --git a/src/client/util/util-i18n.vala b/src/client/util/util-i18n.vala
index 7b6a6ddb..417c3868 100644
--- a/src/client/util/util-i18n.vala
+++ b/src/client/util/util-i18n.vala
@@ -285,8 +285,8 @@ namespace Util.I18n {
             case ALL_MAIL:
                 return _("All Mail");
 
-            case SPAM:
-                return _("Spam");
+            case JUNK:
+                return _("Junk");
 
             case TRASH:
                 return _("Trash");
diff --git a/src/engine/api/geary-account-information.vala b/src/engine/api/geary-account-information.vala
index cdc05eb6..c13f9de8 100644
--- a/src/engine/api/geary-account-information.vala
+++ b/src/engine/api/geary-account-information.vala
@@ -375,7 +375,7 @@ public class Geary.AccountInformation : BaseObject {
      * for this account. The path will be null if Geary has always
      * been told about the special folders by the server, and hasn't
      * had to go looking for them.  Only the ARCHIVE, DRAFTS, SENT,
-     * SPAM, and TRASH special folder types are valid to pass to this
+     * JUNK, and TRASH special folder types are valid to pass to this
      * function.
      */
     public Geary.FolderPath? get_special_folder_path(Geary.SpecialFolderType special) {
@@ -386,7 +386,7 @@ public class Geary.AccountInformation : BaseObject {
             case Geary.SpecialFolderType.SENT:
                 return this.sent_folder_path;
 
-            case Geary.SpecialFolderType.SPAM:
+            case Geary.SpecialFolderType.JUNK:
                 return this.spam_folder_path;
 
             case Geary.SpecialFolderType.TRASH:
@@ -403,7 +403,7 @@ public class Geary.AccountInformation : BaseObject {
      * Sets the configured path for a special folder type.
      *
      * This is only obeyed if the server doesn't tell Geary which
-     * folders are special. Only the DRAFTS, SENT, SPAM, TRASH and
+     * folders are special. Only the DRAFTS, SENT, JUNK, TRASH and
      * ARCHIVE special folder types are valid to pass to this
      * function.
      */
@@ -421,7 +421,7 @@ public class Geary.AccountInformation : BaseObject {
                 this.sent_folder_path = new_path;
             break;
 
-            case Geary.SpecialFolderType.SPAM:
+            case Geary.SpecialFolderType.JUNK:
                 old_path = this.spam_folder_path;
                 this.spam_folder_path = new_path;
             break;
diff --git a/src/engine/api/geary-account.vala b/src/engine/api/geary-account.vala
index 37ade9e3..505b71c6 100644
--- a/src/engine/api/geary-account.vala
+++ b/src/engine/api/geary-account.vala
@@ -404,7 +404,7 @@ public abstract class Geary.Account : BaseObject, Logging.Source {
      * Returns the Folder object with the given special folder type.  The folder will be
      * created on the server if it doesn't already exist.  An error will be thrown if the
      * folder doesn't exist and can't be created.  The only valid special folder types that
-     * can be required are: DRAFTS, SENT, SPAM, and TRASH.
+     * can be required are: DRAFTS, SENT, JUNK, and TRASH.
      */
     public abstract async Geary.Folder get_required_special_folder_async(Geary.SpecialFolderType special,
         Cancellable? cancellable = null) throws Error;
diff --git a/src/engine/api/geary-special-folder-type.vala b/src/engine/api/geary-special-folder-type.vala
index a5fea1a4..98cd65d3 100644
--- a/src/engine/api/geary-special-folder-type.vala
+++ b/src/engine/api/geary-special-folder-type.vala
@@ -14,7 +14,7 @@ public enum Geary.SpecialFolderType {
     FLAGGED,
     IMPORTANT,
     ALL_MAIL,
-    SPAM,
+    JUNK,
     TRASH,
     OUTBOX,
     ARCHIVE;
diff --git a/src/engine/app/app-conversation-monitor.vala b/src/engine/app/app-conversation-monitor.vala
index a4de164d..405c78b5 100644
--- a/src/engine/app/app-conversation-monitor.vala
+++ b/src/engine/app/app-conversation-monitor.vala
@@ -424,7 +424,7 @@ public class Geary.App.ConversationMonitor : BaseObject {
      */
     internal Gee.Collection<Geary.FolderPath> get_search_folder_blacklist() {
         Geary.SpecialFolderType[] blacklisted_folder_types = {
-            Geary.SpecialFolderType.SPAM,
+            Geary.SpecialFolderType.JUNK,
             Geary.SpecialFolderType.TRASH,
             Geary.SpecialFolderType.DRAFTS,
         };
diff --git a/src/engine/app/app-search-folder.vala b/src/engine/app/app-search-folder.vala
index 5867dd0e..53386c51 100644
--- a/src/engine/app/app-search-folder.vala
+++ b/src/engine/app/app-search-folder.vala
@@ -24,7 +24,7 @@ public class Geary.App.SearchFolder :
     public const string MAGIC_BASENAME = "$GearyAccountSearchFolder$";
 
     private const SpecialFolderType[] EXCLUDE_TYPES = {
-        SpecialFolderType.SPAM,
+        SpecialFolderType.JUNK,
         SpecialFolderType.TRASH,
         SpecialFolderType.DRAFTS,
         // Orphan emails (without a folder) are also excluded; see ct or.
diff --git a/src/engine/imap-engine/gmail/imap-engine-gmail-account.vala 
b/src/engine/imap-engine/gmail/imap-engine-gmail-account.vala
index 0f1296db..7621410d 100644
--- a/src/engine/imap-engine/gmail/imap-engine-gmail-account.vala
+++ b/src/engine/imap-engine/gmail/imap-engine-gmail-account.vala
@@ -12,7 +12,7 @@ private class Geary.ImapEngine.GmailAccount : Geary.ImapEngine.GenericAccount {
     private const Geary.SpecialFolderType[] SUPPORTED_SPECIAL_FOLDERS = {
         Geary.SpecialFolderType.DRAFTS,
         Geary.SpecialFolderType.SENT,
-        Geary.SpecialFolderType.SPAM,
+        Geary.SpecialFolderType.JUNK,
         Geary.SpecialFolderType.TRASH,
     };
 
@@ -69,7 +69,7 @@ private class Geary.ImapEngine.GmailAccount : Geary.ImapEngine.GenericAccount {
             case SpecialFolderType.DRAFTS:
                 return new GmailDraftsFolder(this, local_folder, type);
 
-            case SpecialFolderType.SPAM:
+            case SpecialFolderType.JUNK:
             case SpecialFolderType.TRASH:
                 return new GmailSpamTrashFolder(this, local_folder, type);
 
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala 
b/src/engine/imap-engine/imap-engine-generic-account.vala
index 0605c5de..9ecac241 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -20,7 +20,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
     private const Geary.SpecialFolderType[] SUPPORTED_SPECIAL_FOLDERS = {
         Geary.SpecialFolderType.DRAFTS,
         Geary.SpecialFolderType.SENT,
-        Geary.SpecialFolderType.SPAM,
+        Geary.SpecialFolderType.JUNK,
         Geary.SpecialFolderType.TRASH,
         Geary.SpecialFolderType.ARCHIVE,
     };
@@ -898,11 +898,11 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
 
             break;
 
-        case Geary.SpecialFolderType.SPAM:
+        case Geary.SpecialFolderType.JUNK:
             // List of general possible folder names to match for the
-            // Spam mailbox. Separate names using a vertical bar and
-            // put the most common localized name to the front for the
-            // default. English names do not need to be included.
+            // Junk/Spam mailbox. Separate names using a vertical bar
+            // and put the most common localized name to the front for
+            // the default. English names do not need to be included.
             loc_names.add(_("Junk | Spam | Junk Mail | Junk Email | Junk E-Mail | Bulk Mail | Bulk Email | 
Bulk E-Mail"));
             unloc_names.add("Junk | Spam | Junk Mail | Junk Email | Junk E-Mail | Bulk Mail | Bulk Email | 
Bulk E-Mail");
 
diff --git a/src/engine/imap/command/imap-create-command.vala 
b/src/engine/imap/command/imap-create-command.vala
index 5652a0da..c8a2112e 100644
--- a/src/engine/imap/command/imap-create-command.vala
+++ b/src/engine/imap/command/imap-create-command.vala
@@ -41,7 +41,7 @@ public class Geary.Imap.CreateCommand : Command {
         case Geary.SpecialFolderType.ARCHIVE:
             return MailboxAttribute.SPECIAL_FOLDER_ARCHIVE;
 
-        case Geary.SpecialFolderType.SPAM:
+        case Geary.SpecialFolderType.JUNK:
             return MailboxAttribute.SPECIAL_FOLDER_JUNK;
 
         case Geary.SpecialFolderType.FLAGGED:
diff --git a/src/engine/imap/response/imap-mailbox-attributes.vala 
b/src/engine/imap/response/imap-mailbox-attributes.vala
index 2546ba2d..ce1d8fb9 100644
--- a/src/engine/imap/response/imap-mailbox-attributes.vala
+++ b/src/engine/imap/response/imap-mailbox-attributes.vala
@@ -75,10 +75,10 @@ public class Geary.Imap.MailboxAttributes : Geary.Imap.Flags {
             return Geary.SpecialFolderType.SENT;
 
         if (contains(MailboxAttribute.SPECIAL_FOLDER_JUNK))
-            return Geary.SpecialFolderType.SPAM;
+            return Geary.SpecialFolderType.JUNK;
 
         if (contains(MailboxAttribute.SPECIAL_FOLDER_SPAM))
-            return Geary.SpecialFolderType.SPAM;
+            return Geary.SpecialFolderType.JUNK;
 
         if (contains(MailboxAttribute.SPECIAL_FOLDER_STARRED))
             return Geary.SpecialFolderType.FLAGGED;
diff --git a/test/engine/common/common-contact-harvester-test.vala 
b/test/engine/common/common-contact-harvester-test.vala
index e73ccedf..4d4578ae 100644
--- a/test/engine/common/common-contact-harvester-test.vala
+++ b/test/engine/common/common-contact-harvester-test.vala
@@ -84,7 +84,7 @@ class Geary.ContactHarvesterImplTest : TestCase {
     public void blacklisted_folder_type() throws GLib.Error {
         ContactHarvesterImpl whitelisted = new ContactHarvesterImpl(
             this.store,
-            SpecialFolderType.SPAM,
+            SpecialFolderType.JUNK,
             this.senders
         );
         this.email.set_receivers(


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