2011-07-05 [mones] 3.7.9cvs32
[claws.git] / src / etpan / imap-thread.c
index ece7d0e5b1a1b290c9df6d63023a7fc4c15fa5a3..1f30be204e348479f8dde04db3109acd12f7a4ea 100644 (file)
@@ -44,6 +44,7 @@
 #include "ssl_certificate.h"
 #include "socket.h"
 #include "remotefolder.h"
+#include "tags.h"
 
 #define DISABLE_LOG_DURING_LOGIN
 
@@ -1456,13 +1457,13 @@ int imap_threaded_select(Folder * folder, const char * mb,
                                        c_flag = IMAP_FLAG_SEEN;
                                        break;
                                case MAILIMAP_FLAG_KEYWORD:
-                                       if (!strcasecmp(flag->fl_flag->fl_data.fl_keyword, "$Forwarded"))
+                                       if (!strcasecmp(flag->fl_flag->fl_data.fl_keyword, RTAG_FORWARDED))
                                                c_flag = IMAP_FLAG_FORWARDED;
-                                       if (!strcasecmp(flag->fl_flag->fl_data.fl_keyword, "Junk"))
+                                       if (!strcasecmp(flag->fl_flag->fl_data.fl_keyword, RTAG_JUNK))
                                                c_flag = IMAP_FLAG_SPAM;
-                                       if (!strcasecmp(flag->fl_flag->fl_data.fl_keyword, "NonJunk") ||
-                                           !strcasecmp(flag->fl_flag->fl_data.fl_keyword, "NoJunk") ||
-                                           !strcasecmp(flag->fl_flag->fl_data.fl_keyword, "NotJunk"))
+                                       if (!strcasecmp(flag->fl_flag->fl_data.fl_keyword, RTAG_NON_JUNK) ||
+                                           !strcasecmp(flag->fl_flag->fl_data.fl_keyword, RTAG_NO_JUNK) ||
+                                           !strcasecmp(flag->fl_flag->fl_data.fl_keyword, RTAG_NOT_JUNK))
                                                c_flag = IMAP_FLAG_HAM;
                                        break;
                                default:
@@ -1685,7 +1686,7 @@ static void search_run(struct etpan_thread_op * op)
        case IMAP_SEARCH_TYPE_FORWARDED:
                search_type_key = mailimap_search_key_new(MAILIMAP_SEARCH_KEY_KEYWORD,
                                                          NULL, NULL, NULL, NULL, NULL,
-                                                         strdup("$Forwarded"), NULL, NULL, NULL, NULL,
+                                                         strdup(RTAG_FORWARDED), NULL, NULL, NULL, NULL,
                                                          NULL, NULL, NULL, NULL, 0,
                                                          NULL, NULL, NULL, NULL, NULL,
                                                          NULL, 0, NULL, NULL, NULL);
@@ -1693,7 +1694,7 @@ static void search_run(struct etpan_thread_op * op)
        case IMAP_SEARCH_TYPE_SPAM:
                search_type_key = mailimap_search_key_new(MAILIMAP_SEARCH_KEY_KEYWORD,
                                                          NULL, NULL, NULL, NULL, NULL,
-                                                         strdup("Junk"), NULL, NULL, NULL, NULL,
+                                                         strdup(RTAG_JUNK), NULL, NULL, NULL, NULL,
                                                          NULL, NULL, NULL, NULL, 0,
                                                          NULL, NULL, NULL, NULL, NULL,
                                                          NULL, 0, NULL, NULL, NULL);
@@ -2566,13 +2567,13 @@ static int imap_flags_to_flags(struct mailimap_msg_att_dynamic * att_dyn, GSList
                                flags &= ~MSG_NEW;
                                break;
                        case MAILIMAP_FLAG_KEYWORD:
-                               if (!strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "$Forwarded"))
+                               if (!strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, RTAG_FORWARDED))
                                        flags |= MSG_FORWARDED;
-                               else if (!strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "Junk")) 
+                               else if (!strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, RTAG_JUNK)) 
                                        flags |= MSG_SPAM;
-                               else if (!strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "NonJunk") ||
-                                        !strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "NoJunk") ||
-                                        !strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "NotJunk")) 
+                               else if (!strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, RTAG_NON_JUNK) ||
+                                        !strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, RTAG_NO_JUNK) ||
+                                        !strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, RTAG_NOT_JUNK)) 
                                        flags &= ~MSG_SPAM;
                                else if (s_tags)
                                        tags = g_slist_prepend(tags, g_strdup(flag_fetch->fl_flag->fl_data.fl_keyword));