Fixed race condition while handling sent messages

This commit is contained in:
M66B
2019-02-17 09:18:42 +00:00
parent 28fc0d9a18
commit 2f9d4c7ebb
7 changed files with 76 additions and 155 deletions

View File

@@ -102,8 +102,6 @@ public class FragmentIdentity extends FragmentBase {
private CheckBox cbDeliveryReceipt;
private CheckBox cbReadReceipt;
private CheckBox cbStoreSent;
private Button btnSave;
private ContentLoadingProgressBar pbSave;
private TextView tvError;
@@ -169,8 +167,6 @@ public class FragmentIdentity extends FragmentBase {
cbDeliveryReceipt = view.findViewById(R.id.cbDeliveryReceipt);
cbReadReceipt = view.findViewById(R.id.cbReadReceipt);
cbStoreSent = view.findViewById(R.id.cbStoreSent);
btnSave = view.findViewById(R.id.btnSave);
pbSave = view.findViewById(R.id.pbSave);
tvError = view.findViewById(R.id.tvError);
@@ -467,7 +463,6 @@ public class FragmentIdentity extends FragmentBase {
args.putBoolean("plain_only", cbPlainOnly.isChecked());
args.putBoolean("delivery_receipt", cbDeliveryReceipt.isChecked());
args.putBoolean("read_receipt", cbReadReceipt.isChecked());
args.putBoolean("store_sent", cbStoreSent.isChecked());
args.putLong("account", account == null ? -1 : account.id);
args.putInt("auth_type", auth_type);
args.putString("host", etHost.getText().toString());
@@ -527,7 +522,6 @@ public class FragmentIdentity extends FragmentBase {
boolean plain_only = args.getBoolean("plain_only");
boolean delivery_receipt = args.getBoolean("delivery_receipt");
boolean read_receipt = args.getBoolean("read_receipt");
boolean store_sent = args.getBoolean("store_sent");
if (TextUtils.isEmpty(name))
throw new IllegalArgumentException(context.getString(R.string.title_no_name));
@@ -632,8 +626,6 @@ public class FragmentIdentity extends FragmentBase {
identity.plain_only = plain_only;
identity.delivery_receipt = delivery_receipt;
identity.read_receipt = read_receipt;
identity.store_sent = store_sent;
identity.sent_folder = null;
identity.error = null;
identity.last_connected = last_connected;
@@ -734,7 +726,6 @@ public class FragmentIdentity extends FragmentBase {
cbPlainOnly.setChecked(identity == null ? false : identity.plain_only);
cbDeliveryReceipt.setChecked(identity == null ? false : identity.delivery_receipt);
cbReadReceipt.setChecked(identity == null ? false : identity.read_receipt);
cbStoreSent.setChecked(identity == null ? false : identity.store_sent);
color = (identity == null || identity.color == null ? Color.TRANSPARENT : identity.color);