diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-05-13 04:05:08 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-05-13 04:05:08 +0800 |
commit | 22c5c0a25a6036dbb4ee68fce00563a31af6b0cb (patch) | |
tree | 3c60cb34c26f05270a847868852b6721f7d6d38b /camel/providers/imap/camel-imap-folder.c | |
parent | 5a0f1a50cccee6794ca787f4db0cce8e67c7cf51 (diff) | |
download | gsoc2013-evolution-22c5c0a25a6036dbb4ee68fce00563a31af6b0cb.tar.gz gsoc2013-evolution-22c5c0a25a6036dbb4ee68fce00563a31af6b0cb.tar.zst gsoc2013-evolution-22c5c0a25a6036dbb4ee68fce00563a31af6b0cb.zip |
Ignore PERMANENTFLAGS if it gives us an empty set. Works around broken
2004-05-12 Jeffrey Stedfast <fejj@novell.com>
* providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
Ignore PERMANENTFLAGS if it gives us an empty set. Works around
broken IMAP servers like the one in bug #58355.
svn path=/trunk/; revision=25889
Diffstat (limited to 'camel/providers/imap/camel-imap-folder.c')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 7915441047..ce485e5495 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -283,7 +283,9 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response, CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder); CamelImapSummary *imap_summary = CAMEL_IMAP_SUMMARY (folder->summary); unsigned long exists = 0, validity = 0, val, uid; + gboolean got_perm_flags = FALSE; CamelMessageInfo *info; + guint32 perm_flags; GData *fetch_data; int i, count; char *resp; @@ -294,13 +296,16 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response, for (i = 0; i < response->untagged->len; i++) { resp = response->untagged->pdata[i] + 2; - if (!strncasecmp (resp, "FLAGS ", 6) && - !folder->permanent_flags) { + if (!strncasecmp (resp, "FLAGS ", 6) && !got_perm_flags) { resp += 6; folder->permanent_flags = imap_parse_flag_list (&resp); } else if (!strncasecmp (resp, "OK [PERMANENTFLAGS ", 19)) { resp += 19; - folder->permanent_flags = imap_parse_flag_list (&resp); + + /* workaround for broken IMAP servers that send "* OK [PERMANENTFLAGS ()] Permanent flags" + * even tho they do allow storing flags. *Sigh* So many fucking broken IMAP servers out there. */ + if ((perm_flags = imap_parse_flag_list (&resp)) != 0) + folder->permanent_flags = perm_flags; } else if (!strncasecmp (resp, "OK [UIDVALIDITY ", 16)) { validity = strtoul (resp + 16, NULL, 10); } else if (isdigit ((unsigned char)*resp)) { |