Sync instead of store sent

pull/159/head
M66B 5 years ago
parent d02e246189
commit 1d3cd1d44f

@ -384,14 +384,19 @@ See [this FAQ](#user-content-faq111) about why OAuth is not being used.
Sent messages are normally moved from the outbox to the sent folder as soon as your provider adds sent messages to the sent folder.
This requires a sent folder to be selected in the account settings and the sent folder to be set to synchronizing.
If this doesn't happen, your provider might not keep track of sent messages or you might be using an SMTP server not related to the provider.
In these cases you can enable the advanced identity setting *Store sent messages* to let FairEmail add sent messages to the sent folder right after sending a message.
Note that enabling this setting might result in duplicate messages if your provider adds sent messages to the sent folder too.
Also beware that enabling this setting will result in extra data usage, especially when when sending messages with large attachments.
If sent messages in the outbox are not found in the sent folder on a full synchronize, they will be moved from the outbox to the sent folder too.
A full synchronize happens when reconnecting to the server or when synchronizing periodically or manually.
You'll likely want to enable the advanced setting *Store sent messages* instead to move messages to the sent folder sooner.
Some providers do not keep track of sent messages or the used SMTP server might not be related to the provider.
In these cases FairEmail will automatically add sent messages to the sent folder on synchronizing the sent folder, which will happen after a message have been sent.
Note that this will result in extra internet traffic.
~~If this doesn't happen, your provider might not keep track of sent messages or you might be using an SMTP server not related to the provider.~~
~~In these cases you can enable the advanced identity setting *Store sent messages* to let FairEmail add sent messages to the sent folder right after sending a message.~~
~~Note that enabling this setting might result in duplicate messages if your provider adds sent messages to the sent folder too.~~
~~Also beware that enabling this setting will result in extra data usage, especially when when sending messages with large attachments.~~
~~If sent messages in the outbox are not found in the sent folder on a full synchronize, they will be moved from the outbox to the sent folder too.~~
~~A full synchronize happens when reconnecting to the server or when synchronizing periodically or manually.~~
~~You'll likely want to enable the advanced setting *Store sent messages* instead to move messages to the sent folder sooner.~~
<br />

@ -1265,6 +1265,7 @@ class Core {
for (EntityMessage orphan : orphans) {
Log.i(folder.name + " adding orphan id=" + orphan.id + " sent=" + new Date(orphan.sent));
orphan.folder = folder.id;
orphan.ui_hide = 0L;
db.message().updateMessage(orphan);
EntityOperation.queue(context, orphan, EntityOperation.ADD);
}

@ -121,8 +121,6 @@ public class FragmentIdentity extends FragmentBase {
private CheckBox cbDeliveryReceipt;
private CheckBox cbReadReceipt;
private CheckBox cbStoreSent;
private Button btnSave;
private ContentLoadingProgressBar pbSave;
private TextView tvError;
@ -199,8 +197,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);
@ -505,7 +501,6 @@ public class FragmentIdentity extends FragmentBase {
args.putBoolean("encrypt", cbEncrypt.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.putString("host", etHost.getText().toString());
args.putBoolean("starttls", rgEncryption.getCheckedRadioButtonId() == R.id.radio_starttls);
@ -570,7 +565,6 @@ public class FragmentIdentity extends FragmentBase {
boolean encrypt = args.getBoolean("encrypt");
boolean delivery_receipt = args.getBoolean("delivery_receipt");
boolean read_receipt = args.getBoolean("read_receipt");
boolean store_sent = args.getBoolean("store_sent");
boolean should = args.getBoolean("should");
@ -662,8 +656,6 @@ public class FragmentIdentity extends FragmentBase {
return true;
if (!Objects.equals(identity.read_receipt, read_receipt))
return true;
if (!Objects.equals(identity.store_sent, store_sent))
return true;
if (identity.error != null)
return true;
@ -746,7 +738,6 @@ public class FragmentIdentity extends FragmentBase {
identity.encrypt = encrypt;
identity.delivery_receipt = delivery_receipt;
identity.read_receipt = read_receipt;
identity.store_sent = store_sent;
identity.sent_folder = null;
identity.sign_key = null;
identity.error = null;
@ -887,7 +878,6 @@ public class FragmentIdentity extends FragmentBase {
cbEncrypt.setChecked(identity == null ? false : identity.encrypt);
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);

@ -398,16 +398,12 @@ public class ServiceSend extends ServiceBase {
db.message().setMessageSeen(message.id, true);
db.message().setMessageUiSeen(message.id, true);
db.message().setMessageError(message.id, null);
if (!BuildConfig.DEBUG && !debug)
db.message().setMessageUiHide(message.id, new Date().getTime());
EntityFolder sent = db.folder().getFolderByType(message.account, EntityFolder.SENT);
if (ident.store_sent && sent != null) {
db.message().setMessageFolder(message.id, sent.id);
message.folder = sent.id;
EntityOperation.queue(this, message, EntityOperation.ADD);
} else {
if (!BuildConfig.DEBUG && !debug)
db.message().setMessageUiHide(message.id, new Date().getTime());
}
if (sent != null)
EntityOperation.sync(this, sent.id, false);
if (message.inreplyto != null) {
List<EntityMessage> replieds = db.message().getMessageByMsgId(message.account, message.inreplyto);

@ -584,25 +584,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbReadReceipt" />
<CheckBox
android:id="@+id/cbStoreSent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_identity_store_sent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReceipt" />
<TextView
android:id="@+id/tvStoreSent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_identity_store_sent_remark"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbStoreSent" />
<Button
android:id="@+id/btnSave"
android:layout_width="wrap_content"
@ -611,7 +592,7 @@
android:tag="disable"
android:text="@string/title_save"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvStoreSent" />
app:layout_constraintTop_toBottomOf="@id/tvReceipt" />
<eu.faircode.email.ContentLoadingProgressBar
android:id="@+id/pbSave"
@ -695,8 +676,7 @@
cbSenderExtra,tvSenderExtraHint,
tvReplyTo,etReplyTo,tvBcc,etBcc,
cbEncrypt,tvEncryptPro,
cbDeliveryReceipt,cbReadReceipt,tvReceipt,
cbStoreSent,tvStoreSent" />
cbDeliveryReceipt,cbReadReceipt,tvReceipt" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -315,8 +315,6 @@
<string name="title_identity_read_receipt">Request read receipt</string>
<string name="title_identity_delivery_receipt">Request delivery receipt</string>
<string name="title_identity_receipt_remark">Most providers ignore receipt requests</string>
<string name="title_identity_store_sent">Store sent messages</string>
<string name="title_identity_store_sent_remark">Enable this only if your provider does not automatically store sent messages</string>
<string name="title_optional">Optional</string>
<string name="title_recommended">Recommended</string>
<string name="title_account_linked">Linked account</string>

Loading…
Cancel
Save