mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-28 18:59:01 +00:00
Fixed manual sync outbox
This commit is contained in:
parent
16296f3174
commit
95252daa29
2 changed files with 12 additions and 7 deletions
|
@ -38,6 +38,8 @@ import android.widget.ImageView;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -233,7 +235,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|||
|
||||
private void onActionSynchronizeNow() {
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("account", folder.account);
|
||||
args.putLong("account", folder.account == null ? -1 : folder.account);
|
||||
args.putLong("folder", folder.id);
|
||||
|
||||
new SimpleTask<EntityAccount>() {
|
||||
|
@ -245,13 +247,13 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|||
DB db = DB.getInstance(context);
|
||||
EntityOperation.sync(db, folder);
|
||||
|
||||
return db.account().getAccount(account);
|
||||
return (account < 0 ? null : db.account().getAccount(account));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLoaded(Bundle args, EntityAccount account) {
|
||||
if (!"connected".equals(account.state))
|
||||
Toast.makeText(context, R.string.title_sync_queued, Toast.LENGTH_LONG).show();
|
||||
if (account != null && !"connected".equals(account.state))
|
||||
Snackbar.make(itemView, R.string.title_sync_queued, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1087,7 +1087,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
boolean process = false;
|
||||
List<Long> current = new ArrayList<>();
|
||||
for (EntityOperation op : operations) {
|
||||
if (!handling.contains(op.id) || op.error != null)
|
||||
if (!handling.contains(op.id))
|
||||
process = true;
|
||||
current.add(op.id);
|
||||
}
|
||||
|
@ -1391,7 +1391,10 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
doAttachment(folder, op, ifolder, message, jargs, db);
|
||||
|
||||
else if (EntityOperation.SYNC.equals(op.name))
|
||||
synchronizeMessages(account, folder, ifolder, state);
|
||||
if (!EntityFolder.OUTBOX.equals(folder.type))
|
||||
synchronizeMessages(account, folder, ifolder, state);
|
||||
else
|
||||
db.folder().setFolderError(folder.id, null);
|
||||
|
||||
else
|
||||
throw new MessagingException("Unknown operation name=" + op.name);
|
||||
|
@ -2401,7 +2404,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
boolean process = false;
|
||||
List<Long> current = new ArrayList<>();
|
||||
for (EntityOperation op : operations) {
|
||||
if (!handling.contains(op.id) || op.error != null)
|
||||
if (!handling.contains(op.id))
|
||||
process = true;
|
||||
current.add(op.id);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue