Commit 5de971cc authored by Michael Gratton's avatar Michael Gratton 🤞

Merge branch 'wip/34-yahoo-fixes' into 'master'

Misc fixes for Yahoo accounts

See merge request !95
parents 36b86153 cd050baa
Pipeline #55496 failed with stages
in 12 minutes and 24 seconds
......@@ -9,9 +9,6 @@
private class Geary.ImapEngine.YahooAccount : Geary.ImapEngine.GenericAccount {
private static Gee.HashMap<Geary.FolderPath, Geary.SpecialFolderType>? special_map = null;
public static void setup_service(ServiceInformation service) {
switch (service.protocol) {
case Protocol.IMAP:
......@@ -34,33 +31,26 @@ private class Geary.ImapEngine.YahooAccount : Geary.ImapEngine.GenericAccount {
Endpoint incoming_remote,
Endpoint outgoing_remote) {
base(config, local, incoming_remote, outgoing_remote);
if (special_map == null) {
special_map = new Gee.HashMap<Geary.FolderPath, Geary.SpecialFolderType>();
FolderRoot root = this.local.imap_folder_root;
special_map.set(
this.local.imap_folder_root.inbox, Geary.SpecialFolderType.INBOX
);
special_map.set(
root.get_child("Sent"), Geary.SpecialFolderType.SENT
);
special_map.set(
root.get_child("Draft"), Geary.SpecialFolderType.DRAFTS
);
special_map.set(
root.get_child("Bulk Mail"), Geary.SpecialFolderType.SPAM
);
special_map.set(
root.get_child("Trash"), Geary.SpecialFolderType.TRASH
);
}
}
protected override MinimalFolder new_folder(ImapDB.Folder local_folder) {
Geary.FolderPath path = local_folder.get_path();
SpecialFolderType special_folder_type = special_map.has_key(path) ? special_map.get(path)
: Geary.SpecialFolderType.NONE;
return new YahooFolder(this, local_folder, special_folder_type);
FolderPath path = local_folder.get_path();
SpecialFolderType type;
if (Imap.MailboxSpecifier.folder_path_is_inbox(path)) {
type = SpecialFolderType.INBOX;
} else {
// Despite Yahoo not advertising that it supports
// SPECIAL-USE via its CAPABILITIES, it lists the
// appropriate attributes in LIST results anyway, so we
// can just consult that. :|
type = local_folder.get_properties().attrs.get_special_folder_type();
// There can be only one Inbox
if (type == SpecialFolderType.INBOX) {
type = SpecialFolderType.NONE;
}
}
return new YahooFolder(this, local_folder, type);
}
}
......@@ -50,7 +50,7 @@ public class Geary.Imap.ClientSession : BaseObject {
* new messages or status updates, this is a useful timeout for
* polling for changes.
*/
public const uint AGGRESSIVE_KEEPALIVE_SEC = 5 * 60;
public const uint AGGRESSIVE_KEEPALIVE_SEC = 2 * 60;
/**
* Default keep-alive interval in the Selected state.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment