Get rid of a whole lot of crazy code that forced repeated attachment
downloads with the intent of only having one attachment downloaded at a time.
This commit is contained in:
parent
35f19abc9f
commit
e44a74c652
2 changed files with 11 additions and 20 deletions
|
@ -3230,13 +3230,6 @@ public class MessagingController implements Runnable
|
||||||
{
|
{
|
||||||
LocalStore localStore = account.getLocalStore();
|
LocalStore localStore = account.getLocalStore();
|
||||||
|
|
||||||
/*
|
|
||||||
* We clear out any attachments already cached in the entire store and then
|
|
||||||
* we update the passed in message to reflect that there are no cached
|
|
||||||
* attachments. This is in support of limiting the account to having one
|
|
||||||
* attachment downloaded at a time.
|
|
||||||
*/
|
|
||||||
localStore.pruneCachedAttachments();
|
|
||||||
ArrayList<Part> viewables = new ArrayList<Part>();
|
ArrayList<Part> viewables = new ArrayList<Part>();
|
||||||
ArrayList<Part> attachments = new ArrayList<Part>();
|
ArrayList<Part> attachments = new ArrayList<Part>();
|
||||||
MimeUtility.collectParts(message, viewables, attachments);
|
MimeUtility.collectParts(message, viewables, attachments);
|
||||||
|
|
|
@ -793,14 +793,16 @@ public class LocalStore extends Store implements Serializable, LocalStoreMigrati
|
||||||
throw new Error("Database upgrade failed!");
|
throw new Error("Database upgrade failed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
// Unless we're blowing away the whole data store, there's no reason to prune attachments
|
||||||
{
|
// every time the user upgrades. it'll just cost them money and pain.
|
||||||
pruneCachedAttachments(true);
|
// try
|
||||||
}
|
//{
|
||||||
catch (Exception me)
|
// pruneCachedAttachments(true);
|
||||||
{
|
//}
|
||||||
Log.e(K9.LOG_TAG, "Exception while force pruning attachments during DB update", me);
|
//catch (Exception me)
|
||||||
}
|
//{
|
||||||
|
// Log.e(K9.LOG_TAG, "Exception while force pruning attachments during DB update", me);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getSize() throws UnavailableStorageException
|
public long getSize() throws UnavailableStorageException
|
||||||
|
@ -835,11 +837,7 @@ public class LocalStore extends Store implements Serializable, LocalStoreMigrati
|
||||||
public void compact() throws MessagingException
|
public void compact() throws MessagingException
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "Before prune size = " + getSize());
|
Log.i(K9.LOG_TAG, "Before compaction size = " + getSize());
|
||||||
|
|
||||||
pruneCachedAttachments();
|
|
||||||
if (K9.DEBUG)
|
|
||||||
Log.i(K9.LOG_TAG, "After prune / before compaction size = " + getSize());
|
|
||||||
|
|
||||||
execute(false, new DbCallback<Void>()
|
execute(false, new DbCallback<Void>()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue