Show if receipt was requested, refactoring

pull/155/head
M66B 6 years ago
parent 95738a210e
commit 7c2f221282

File diff suppressed because it is too large Load Diff

@ -28,10 +28,6 @@ import android.os.Bundle;
import android.view.View;
import android.widget.ScrollView;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
@ -41,6 +37,10 @@ import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.OnLifecycleEvent;
import androidx.preference.PreferenceManager;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
abstract class ActivityBase extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
private boolean contacts;
private List<IBackPressedListener> backPressedListeners = new ArrayList<>();

@ -31,6 +31,12 @@ import android.provider.Settings;
import android.util.Base64;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import com.android.billingclient.api.BillingClient;
import com.android.billingclient.api.BillingClientStateListener;
import com.android.billingclient.api.BillingFlowParams;
@ -45,12 +51,6 @@ import java.security.Signature;
import java.security.spec.X509EncodedKeySpec;
import java.util.List;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedListener {
private BillingClient billingClient = null;

@ -27,6 +27,11 @@ import android.text.Spanned;
import android.text.TextUtils;
import android.view.MenuItem;
import androidx.core.app.TaskStackBuilder;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import org.jsoup.Jsoup;
import org.jsoup.safety.Whitelist;
@ -35,11 +40,6 @@ import java.util.ArrayList;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import androidx.core.app.TaskStackBuilder;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
public class ActivityCompose extends ActivityBilling implements FragmentManager.OnBackStackChangedListener {
static final int REQUEST_CONTACT_TO = 1;
static final int REQUEST_CONTACT_CC = 2;

@ -8,14 +8,14 @@ import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.constraintlayout.widget.Group;
import com.google.android.material.snackbar.Snackbar;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import androidx.constraintlayout.widget.Group;
public class ActivityDSN extends ActivityBase {
@Override
protected void onCreate(Bundle savedInstanceState) {

@ -9,6 +9,8 @@ import android.text.Spanned;
import android.view.View;
import android.widget.TextView;
import androidx.constraintlayout.widget.Group;
import com.google.android.material.snackbar.Snackbar;
import java.io.BufferedInputStream;
@ -19,8 +21,6 @@ import java.util.Properties;
import javax.mail.Session;
import javax.mail.internet.MimeMessage;
import androidx.constraintlayout.widget.Group;
public class ActivityEml extends ActivityBase {
@Override
protected void onCreate(Bundle savedInstanceState) {

@ -26,13 +26,13 @@ import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import java.util.List;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.preference.PreferenceManager;
import java.util.List;
public class ActivityMain extends AppCompatActivity implements FragmentManager.OnBackStackChangedListener, SharedPreferences.OnSharedPreferenceChangeListener {
@Override
protected void onCreate(Bundle savedInstanceState) {

@ -42,6 +42,16 @@ import android.widget.ListView;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.documentfile.provider.DocumentFile;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputLayout;
@ -72,16 +82,6 @@ import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.documentfile.provider.DocumentFile;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
public class ActivitySetup extends ActivityBilling implements FragmentManager.OnBackStackChangedListener {
private View view;
private DrawerLayout drawerLayout;

@ -48,6 +48,19 @@ import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.constraintlayout.widget.Group;
import androidx.documentfile.provider.DocumentFile;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import com.google.android.material.snackbar.Snackbar;
import org.json.JSONArray;
@ -86,19 +99,6 @@ import javax.mail.Session;
import javax.mail.internet.MimeMessage;
import javax.net.ssl.HttpsURLConnection;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.constraintlayout.widget.Group;
import androidx.documentfile.provider.DocumentFile;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
public class ActivityView extends ActivityBilling implements FragmentManager.OnBackStackChangedListener {
private String startup;

@ -29,6 +29,13 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.Group;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import java.text.Collator;
import java.text.DateFormat;
import java.text.NumberFormat;
@ -39,13 +46,6 @@ import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.Group;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHolder> {
private Context context;
private boolean settings;

@ -27,13 +27,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@ -41,6 +34,13 @@ import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
public class AdapterAnswer extends RecyclerView.Adapter<AdapterAnswer.ViewHolder> {
private Context context;
private LifecycleOwner owner;

@ -36,13 +36,6 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.core.content.FileProvider;
import androidx.lifecycle.LifecycleOwner;
@ -52,6 +45,13 @@ import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.ViewHolder> {
private Context context;
private LayoutInflater inflater;

@ -32,16 +32,16 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
public class AdapterContact extends RecyclerView.Adapter<AdapterContact.ViewHolder> {
private Context context;
private LifecycleOwner owner;

@ -40,16 +40,6 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.android.material.snackbar.Snackbar;
import java.text.Collator;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.PopupMenu;
import androidx.lifecycle.LifecycleOwner;
@ -62,6 +52,16 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.snackbar.Snackbar;
import java.text.Collator;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder> {
private Context context;
private LayoutInflater inflater;

@ -28,6 +28,12 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import java.text.Collator;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@ -37,12 +43,6 @@ import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHolder> {
private Context context;
private LayoutInflater inflater;

@ -34,12 +34,6 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.core.content.FileProvider;
import androidx.lifecycle.LifecycleOwner;
@ -47,6 +41,12 @@ import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder> {
private Context context;
private LayoutInflater inflater;

@ -25,16 +25,16 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
public class AdapterLog extends RecyclerView.Adapter<AdapterLog.ViewHolder> {
private Context context;
private LayoutInflater inflater;

@ -76,6 +76,24 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.PopupMenu;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.paging.AsyncPagedListDiffer;
import androidx.paging.PagedList;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.selection.ItemDetailsLookup;
import androidx.recyclerview.selection.SelectionTracker;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.snackbar.Snackbar;
@ -101,24 +119,6 @@ import java.util.Locale;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.PopupMenu;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.paging.AsyncPagedListDiffer;
import androidx.paging.PagedList;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.selection.ItemDetailsLookup;
import androidx.recyclerview.selection.SelectionTracker;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHolder> {
private Context context;
private LayoutInflater inflater;
@ -186,6 +186,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ImageView ivSnoozed;
private ImageView ivBrowsed;
private ImageView ivAnswered;
private ImageView ivReceipt;
private ImageView ivAttachments;
private TextView tvSubject;
private TextView tvFolder;
@ -270,6 +271,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivSnoozed = itemView.findViewById(R.id.ivSnoozed);
ivBrowsed = itemView.findViewById(R.id.ivBrowsed);
ivAnswered = itemView.findViewById(R.id.ivAnswered);
ivReceipt = itemView.findViewById(R.id.ivReceipt);
ivAttachments = itemView.findViewById(R.id.ivAttachments);
tvSubject = itemView.findViewById(R.id.tvSubject);
tvPreview = itemView.findViewById(R.id.tvPreview);
@ -426,6 +428,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivSnoozed.setVisibility(View.GONE);
ivBrowsed.setVisibility(View.GONE);
ivAnswered.setVisibility(View.GONE);
ivReceipt.setVisibility(View.GONE);
ivAttachments.setVisibility(View.GONE);
tvSubject.setText(null);
tvFolder.setText(null);
@ -485,6 +488,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivSnoozed.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
ivBrowsed.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
ivAnswered.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
ivReceipt.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
ivAttachments.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
tvSubject.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
tvFolder.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
@ -542,6 +546,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivSnoozed.setVisibility(message.ui_snoozed == null ? View.GONE : View.VISIBLE);
ivBrowsed.setVisibility(message.ui_browsed ? View.VISIBLE : View.GONE);
ivAnswered.setVisibility(message.ui_answered ? View.VISIBLE : View.GONE);
ivReceipt.setVisibility(message.receipt_request != null && message.receipt_request ? View.VISIBLE : View.GONE);
ivAttachments.setVisibility(message.attachments > 0 ? View.VISIBLE : View.GONE);
if (viewType == ViewType.FOLDER)

@ -29,12 +29,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.json.JSONArray;
import org.json.JSONException;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@ -43,6 +37,12 @@ import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import org.json.JSONArray;
import org.json.JSONException;
import java.util.ArrayList;
import java.util.List;
public class AdapterOperation extends RecyclerView.Adapter<AdapterOperation.ViewHolder> {
private Context context;
private LayoutInflater inflater;

@ -27,13 +27,6 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@ -41,6 +34,13 @@ import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
private Context context;
private LifecycleOwner owner;

@ -37,6 +37,8 @@ import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.webkit.CookieManager;
import androidx.annotation.RequiresApi;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@ -50,8 +52,6 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import androidx.annotation.RequiresApi;
public class ApplicationEx extends Application {
private Thread.UncaughtExceptionHandler prev = null;

@ -21,14 +21,14 @@ package eu.faircode.email;
import android.os.Handler;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import androidx.lifecycle.GenericLifecycleObserver;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.paging.PagedList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMessageEx> {
private ViewModelBrowse model;
private Handler handler;

@ -11,6 +11,8 @@ import android.net.Uri;
import android.provider.ContactsContract;
import android.util.TypedValue;
import androidx.preference.PreferenceManager;
import java.io.InputStream;
import java.util.Date;
import java.util.HashMap;
@ -19,8 +21,6 @@ import java.util.Map;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import androidx.preference.PreferenceManager;
public class ContactInfo {
private String email;
private Bitmap bitmap;

@ -15,6 +15,10 @@ import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.core.app.NotificationCompat;
import androidx.preference.PreferenceManager;
import com.sun.mail.iap.ConnectionException;
import com.sun.mail.iap.Response;
import com.sun.mail.imap.AppendUID;
@ -82,9 +86,6 @@ import javax.mail.search.ReceivedDateTerm;
import javax.mail.search.SearchTerm;
import javax.net.ssl.SSLException;
import androidx.annotation.NonNull;
import androidx.core.app.NotificationCompat;
import androidx.preference.PreferenceManager;
import me.leolin.shortcutbadger.ShortcutBadger;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
@ -1173,6 +1174,7 @@ class Core {
// Local address contains control or whitespace in string ``mailing list someone@example.org''
message.deliveredto = helper.getDeliveredTo();
message.thread = helper.getThreadId(context, account.id, uid);
message.receipt_request = helper.getReceiptRequested();
message.dkim = MessageHelper.getAuthentication("dkim", authentication);
message.spf = MessageHelper.getAuthentication("spf", authentication);
message.dmarc = MessageHelper.getAuthentication("dmarc", authentication);

@ -5,6 +5,15 @@ import android.content.SharedPreferences;
import android.database.Cursor;
import android.text.TextUtils;
import androidx.preference.PreferenceManager;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.room.TypeConverter;
import androidx.room.TypeConverters;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@ -18,14 +27,6 @@ import java.util.concurrent.Executors;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import androidx.preference.PreferenceManager;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.room.TypeConverter;
import androidx.room.TypeConverters;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
/*
@ -50,7 +51,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 65,
version = 66,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -701,6 +702,13 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `identity` ADD COLUMN `sender_extra` INTEGER NOT NULL DEFAULT 0");
}
})
.addMigrations(new Migration(65, 66) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `message` ADD COLUMN `receipt_request` INTEGER");
}
})
.build();
}

@ -19,14 +19,14 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import java.util.List;
@Dao
public interface DaoAccount {
@Query("SELECT * FROM account")

@ -19,14 +19,14 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import java.util.List;
@Dao
public interface DaoAnswer {
@Query("SELECT * FROM answer")

@ -19,13 +19,13 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import java.util.List;
@Dao
public interface DaoAttachment {
@Query("SELECT * FROM attachment" +

@ -21,14 +21,14 @@ package eu.faircode.email;
import android.database.Cursor;
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import java.util.List;
@Dao
public interface DaoContact {
@Query("SELECT * FROM contact" +

@ -19,13 +19,13 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import java.util.List;
@Dao
public interface DaoFolder {
@Query("SELECT * FROM folder" +

@ -19,14 +19,14 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import java.util.List;
@Dao
public interface DaoIdentity {
@Query("SELECT identity.*, account.name AS accountName FROM identity" +

@ -19,13 +19,13 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import java.util.List;
@Dao
public interface DaoLog {
@Query("SELECT * FROM log" +

@ -19,8 +19,6 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.paging.DataSource;
import androidx.room.Dao;
@ -29,6 +27,8 @@ import androidx.room.Query;
import androidx.room.RoomWarnings;
import androidx.room.Update;
import java.util.List;
@Dao
public interface DaoMessage {
@ -324,6 +324,9 @@ public interface DaoMessage {
@Query("UPDATE message SET sent = :sent WHERE id = :id")
int setMessageSent(long id, Long sent);
@Query("UPDATE message SET receipt_request = :receipt_request WHERE id = :id")
int setMessageReceiptRequested(long id, Boolean receipt_request);
@Query("UPDATE message SET avatar = :avatar WHERE id = :id")
int setMessageAvatar(long id, String avatar);

@ -19,13 +19,13 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import java.util.List;
@Dao
public interface DaoOperation {
@Query("SELECT operation.*, account.name AS accountName, folder.name AS folderName" +

@ -19,14 +19,14 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.List;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import java.util.List;
@Dao
public interface DaoRule {
@Query("SELECT * FROM rule" +

@ -9,13 +9,13 @@ import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.TimePicker;
import androidx.lifecycle.LifecycleOwner;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import androidx.lifecycle.LifecycleOwner;
public class DialogDuration {
static void show(Context context, LifecycleOwner owner, int title, final IDialogDuration intf) {
final View dview = LayoutInflater.from(context).inflate(R.layout.dialog_duration, null);

@ -8,12 +8,12 @@ import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public class DrawerAdapter extends ArrayAdapter<DrawerItem> {
private List<DrawerItem> items = new ArrayList<>();

@ -25,17 +25,17 @@ import android.app.NotificationManager;
import android.content.Context;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.Serializable;
import java.util.Objects;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
@Entity(
tableName = EntityAccount.TABLE_NAME,
indices = {

@ -19,6 +19,10 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import org.json.JSONException;
import org.json.JSONObject;
@ -27,10 +31,6 @@ import java.io.Serializable;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
// https://developer.android.com/training/data-storage/room/defining-data
@Entity(

@ -22,6 +22,12 @@ package eu.faircode.email;
import android.content.Context;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import java.io.File;
import java.io.IOException;
import java.util.List;
@ -29,12 +35,6 @@ import java.util.Objects;
import javax.mail.Part;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import static androidx.room.ForeignKey.CASCADE;
@Entity(

@ -19,12 +19,6 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import org.json.JSONException;
import org.json.JSONObject;
import java.io.Serializable;
import java.util.Objects;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.room.Entity;
@ -32,6 +26,12 @@ import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.Serializable;
import java.util.Objects;
import static androidx.room.ForeignKey.CASCADE;
// https://developer.android.com/training/data-storage/room/defining-data

@ -21,6 +21,12 @@ package eu.faircode.email;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@ -35,12 +41,6 @@ import java.util.List;
import java.util.Locale;
import java.util.Objects;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import static androidx.room.ForeignKey.CASCADE;
@Entity(

@ -19,17 +19,17 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Objects;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Objects;
import static androidx.room.ForeignKey.CASCADE;
@Entity(

@ -21,15 +21,15 @@ package eu.faircode.email;
import android.content.Context;
import java.util.Date;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import java.util.Date;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Entity(
tableName = EntityLog.TABLE_NAME,
foreignKeys = {

@ -24,6 +24,12 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import java.io.File;
import java.io.Serializable;
import java.util.Date;
@ -32,12 +38,6 @@ import java.util.Random;
import javax.mail.Address;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import static androidx.room.ForeignKey.CASCADE;
import static androidx.room.ForeignKey.SET_NULL;
@ -90,6 +90,7 @@ public class EntityMessage implements Serializable {
public String deliveredto;
public String inreplyto;
public String thread; // compose = null
public Boolean receipt_request;
public Boolean dkim;
public Boolean spf;
public Boolean dmarc;

@ -22,6 +22,13 @@ package eu.faircode.email;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.annotation.NonNull;
import androidx.preference.PreferenceManager;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import org.json.JSONArray;
import org.json.JSONException;
@ -31,13 +38,6 @@ import java.util.Calendar;
import java.util.Date;
import java.util.Objects;
import androidx.annotation.NonNull;
import androidx.preference.PreferenceManager;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import static androidx.room.ForeignKey.CASCADE;
@Entity(

@ -23,6 +23,12 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import org.json.JSONException;
import org.json.JSONObject;
@ -40,12 +46,6 @@ import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import static androidx.room.ForeignKey.CASCADE;
@Entity(

@ -58,6 +58,12 @@ import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.FragmentTransaction;
import com.android.colorpicker.ColorPickerDialog;
import com.android.colorpicker.ColorPickerSwatch;
import com.google.android.material.snackbar.Snackbar;
@ -79,12 +85,6 @@ import javax.mail.Folder;
import javax.mail.Session;
import javax.mail.Store;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.FragmentTransaction;
import static android.accounts.AccountManager.newChooseAccountIntent;
public class FragmentAccount extends FragmentBase {

@ -32,11 +32,6 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView;
@ -48,6 +43,11 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
public class FragmentAccounts extends FragmentBase {
private boolean settings;
private RecyclerView rvAccount;

@ -28,12 +28,12 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import com.google.android.material.bottomnavigation.BottomNavigationView;
public class FragmentAnswer extends FragmentBase {
private ViewGroup view;
private EditText etName;

@ -24,11 +24,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
@ -38,6 +33,11 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
public class FragmentAnswers extends FragmentBase {
private RecyclerView rvAnswer;
private ContentLoadingProgressBar pbWait;

@ -82,6 +82,18 @@ import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import androidx.cursoradapter.widget.SimpleCursorAdapter;
import androidx.exifinterface.media.ExifInterface;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
import com.google.android.material.snackbar.Snackbar;
@ -120,18 +132,6 @@ import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import androidx.cursoradapter.widget.SimpleCursorAdapter;
import androidx.exifinterface.media.ExifInterface;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import static android.app.Activity.RESULT_OK;
public class FragmentCompose extends FragmentBase {

@ -34,9 +34,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView;
@ -45,6 +42,9 @@ import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
public class FragmentContacts extends FragmentBase {
private RecyclerView rvContacts;
private ContentLoadingProgressBar pbWait;

@ -35,13 +35,13 @@ import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.snackbar.Snackbar;
import java.util.Calendar;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
public class FragmentFolder extends FragmentBase {
private ViewGroup view;
private EditText etName;

@ -34,14 +34,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView;
@ -55,6 +47,14 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FragmentFolders extends FragmentBase {
private ViewGroup view;
private SwipeRefreshLayout swipeRefresh;

@ -26,11 +26,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
@ -40,6 +35,11 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
public class FragmentIdentities extends FragmentBase {
private RecyclerView rvIdentity;
private ContentLoadingProgressBar pbWait;

@ -47,6 +47,11 @@ import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.FragmentTransaction;
import com.android.colorpicker.ColorPickerDialog;
import com.android.colorpicker.ColorPickerSwatch;
import com.google.android.material.snackbar.Snackbar;
@ -65,11 +70,6 @@ import javax.mail.AuthenticationFailedException;
import javax.mail.Session;
import javax.mail.Transport;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.FragmentTransaction;
public class FragmentIdentity extends FragmentBase {
private ViewGroup view;

@ -27,10 +27,6 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
@ -38,6 +34,10 @@ import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class FragmentLogs extends FragmentBase {
private RecyclerView rvLog;
private ContentLoadingProgressBar pbWait;

@ -56,25 +56,6 @@ import android.widget.ImageButton;
import android.widget.SeekBar;
import android.widget.TextView;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import java.text.Collator;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.PopupMenu;
@ -100,6 +81,25 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import java.text.Collator;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static android.text.format.DateUtils.DAY_IN_MILLIS;
import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
import static android.text.format.DateUtils.FORMAT_SHOW_WEEKDAY;

@ -33,9 +33,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
@ -43,6 +40,9 @@ import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
public class FragmentOperations extends FragmentBase {
private TextView tvNoOperation;
private RecyclerView rvOperation;

@ -46,9 +46,6 @@ import android.widget.Spinner;
import android.widget.TextView;
import android.widget.TimePicker;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat;
@ -59,6 +56,9 @@ import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import static android.app.Activity.RESULT_OK;
public class FragmentOptions extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {

@ -50,6 +50,10 @@ import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputLayout;
import com.sun.mail.imap.IMAPFolder;
@ -65,10 +69,6 @@ import javax.mail.Folder;
import javax.mail.Session;
import javax.mail.Transport;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import static android.accounts.AccountManager.newChooseAccountIntent;
import static android.app.Activity.RESULT_OK;

@ -41,6 +41,12 @@ import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.FragmentTransaction;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.snackbar.Snackbar;
@ -50,12 +56,6 @@ import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.FragmentTransaction;
import static android.app.Activity.RESULT_OK;
public class FragmentRule extends FragmentBase {

@ -24,11 +24,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
@ -38,6 +33,11 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import java.util.List;
public class FragmentRules extends FragmentBase {
private RecyclerView rvRule;
private ContentLoadingProgressBar pbWait;

@ -42,14 +42,14 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer;
import java.util.List;
public class FragmentSetup extends FragmentBase {
private ViewGroup view;

@ -58,6 +58,13 @@ import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.preference.PreferenceManager;
import com.android.billingclient.api.BillingClient;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.sun.mail.imap.IMAPStore;
@ -107,13 +114,6 @@ import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;
import javax.net.ssl.HttpsURLConnection;
import androidx.annotation.NonNull;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.preference.PreferenceManager;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION;

@ -31,6 +31,12 @@ import android.text.Spanned;
import android.text.TextUtils;
import android.util.Base64;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.text.HtmlCompat;
import androidx.core.util.PatternsCompat;
import androidx.preference.PreferenceManager;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Attribute;
import org.jsoup.nodes.Document;
@ -57,12 +63,6 @@ import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.text.HtmlCompat;
import androidx.core.util.PatternsCompat;
import androidx.preference.PreferenceManager;
import static androidx.core.text.HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM;
import static androidx.core.text.HtmlCompat.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE;

@ -25,11 +25,11 @@ import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import androidx.core.graphics.ColorUtils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import androidx.core.graphics.ColorUtils;
class Identicon {
static Bitmap generate(String email, int size, int pixels, boolean dark) {
byte[] hash;

@ -453,6 +453,11 @@ public class MessageHelper {
return (TextUtils.isEmpty(msgid) ? Long.toString(uid) : msgid);
}
boolean getReceiptRequested() throws MessagingException {
return (imessage.getHeader("Return-Receipt-To") != null ||
imessage.getHeader("Disposition-Notification-To") != null);
}
String getAuthentication() throws MessagingException {
String header = imessage.getHeader("Authentication-Results", "");
return (header == null ? null : header.replaceAll("\\r?\\n", ""));

@ -32,6 +32,11 @@ import android.os.PowerManager;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleService;
import androidx.lifecycle.Observer;
import java.io.File;
import java.io.IOException;
import java.net.Inet4Address;
@ -54,11 +59,6 @@ import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleService;
import androidx.lifecycle.Observer;
public class ServiceSend extends LifecycleService {
private int lastUnsent = 0;
@ -348,6 +348,7 @@ public class ServiceSend extends LifecycleService {
db.beginTransaction();
db.message().setMessageSent(message.id, time);
db.message().setMessageReceiptRequested(message.id, ident.delivery_receipt || ident.read_receipt);
db.message().setMessageSeen(message.id, true);
db.message().setMessageUiSeen(message.id, true);
db.message().setMessageError(message.id, null);

@ -35,6 +35,13 @@ import android.os.Build;
import android.os.Handler;
import android.os.PowerManager;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleService;
import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager;
import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPMessage;
import com.sun.mail.imap.IMAPStore;
@ -74,12 +81,6 @@ import javax.mail.event.MessageCountEvent;
import javax.mail.event.StoreEvent;
import javax.mail.event.StoreListener;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleService;
import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager;
import me.leolin.shortcutbadger.ShortcutBadger;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;

@ -27,10 +27,10 @@ import android.os.IBinder;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import java.util.List;
import androidx.lifecycle.Observer;
import java.util.List;
@TargetApi(Build.VERSION_CODES.N)
public class ServiceTileUnseen extends TileService {
private TwoStateOwner owner = new TwoStateOwner("ServiceTileUnseen");

@ -15,12 +15,12 @@ import android.os.Bundle;
import android.provider.ContactsContract;
import android.text.TextUtils;
import androidx.lifecycle.LifecycleOwner;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import androidx.lifecycle.LifecycleOwner;
public class Shortcuts {
static void update(final Context context, final LifecycleOwner owner) {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N_MR1)

@ -23,9 +23,6 @@ import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
@ -35,6 +32,9 @@ import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleService;
import androidx.lifecycle.OnLifecycleEvent;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
//
// This simple task is simple to use, but it is also simple to cause bugs that can easily lead to crashes
// Make sure to not access any member in any outer scope from onExecute

@ -19,10 +19,10 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.Objects;
import androidx.room.Ignore;
import java.util.Objects;
public class TupleMessageEx extends EntityMessage {
public String accountName;
public Integer accountColor;

@ -22,6 +22,9 @@ package eu.faircode.email;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.lifecycle.ViewModel;
import androidx.preference.PreferenceManager;
import com.sun.mail.iap.Argument;
import com.sun.mail.iap.Response;
import com.sun.mail.imap.IMAPFolder;
@ -54,9 +57,6 @@ import javax.mail.search.RecipientStringTerm;
import javax.mail.search.SearchTerm;
import javax.mail.search.SubjectTerm;
import androidx.lifecycle.ViewModel;
import androidx.preference.PreferenceManager;
public class ViewModelBrowse extends ViewModel {
private State currentState = null;

@ -19,9 +19,6 @@ package eu.faircode.email;
Copyright 2018-2019 by Marcel Bokhorst (M66B)
*/
import java.util.HashMap;
import java.util.Map;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
@ -31,6 +28,9 @@ import androidx.lifecycle.OnLifecycleEvent;
import androidx.lifecycle.ViewModel;
import androidx.paging.PagedList;
import java.util.HashMap;
import java.util.Map;
public class ViewModelMessages extends ViewModel {
private Map<AdapterMessage.ViewType, LiveData<PagedList<TupleMessageEx>>> messages = new HashMap<>();

@ -4,6 +4,14 @@ import android.content.Context;
import android.net.Uri;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.work.Constraints;
import androidx.work.PeriodicWorkRequest;
import androidx.work.WorkInfo;
import androidx.work.WorkManager;
import androidx.work.Worker;
import androidx.work.WorkerParameters;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@ -13,14 +21,6 @@ import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import androidx.annotation.NonNull;
import androidx.work.Constraints;
import androidx.work.PeriodicWorkRequest;
import androidx.work.WorkInfo;
import androidx.work.WorkManager;
import androidx.work.Worker;
import androidx.work.WorkerParameters;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
public class WorkerCleanup extends Worker {

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M14,10L2,10v2h12v-2zM14,6L2,6v2h12L14,6zM2,16h8v-2L2,14v2zM21.5,11.5L23,13l-6.99,7 -4.51,-4.5L13,14l3.01,3 5.49,-5.5z"/>
</vector>

@ -311,6 +311,27 @@
app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintTop_toTopOf="@id/ivAnswered" />
<ImageView
android:id="@+id/ivReceipt"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="24dp"
android:src="@drawable/baseline_playlist_add_check_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivAnswered" />
<TextView
android:id="@+id/tvReceipt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:text="@string/title_legend_receipt"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="@id/ivReceipt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivReceipt"
app:layout_constraintTop_toTopOf="@id/ivReceipt" />
<ImageView
android:id="@+id/ivAttachment"
android:layout_width="24dp"
@ -318,7 +339,7 @@
android:layout_marginTop="24dp"
android:src="@drawable/baseline_attachment_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivAnswered" />
app:layout_constraintTop_toBottomOf="@id/ivReceipt" />
<TextView
android:id="@+id/tvAttachment"

@ -146,6 +146,16 @@
app:layout_constraintStart_toEndOf="@id/ivBrowsed"
app:layout_constraintTop_toTopOf="@+id/tvSubject" />
<ImageView
android:id="@+id/ivReceipt"
android:layout_width="21dp"
android:layout_height="21dp"
android:layout_marginStart="6dp"
android:src="@drawable/baseline_playlist_add_check_24"
app:layout_constraintBottom_toBottomOf="@+id/tvSubject"
app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintTop_toTopOf="@+id/tvSubject" />
<ImageView
android:id="@+id/ivAttachments"
android:layout_width="21dp"
@ -153,7 +163,7 @@
android:layout_marginStart="6dp"
android:src="@drawable/baseline_attachment_24"
app:layout_constraintBottom_toBottomOf="@+id/tvSubject"
app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintStart_toEndOf="@id/ivReceipt"
app:layout_constraintTop_toTopOf="@+id/tvSubject" />
<TextView

@ -170,6 +170,16 @@
app:layout_constraintStart_toEndOf="@id/ivBrowsed"
app:layout_constraintTop_toTopOf="@+id/tvFolder" />
<ImageView
android:id="@+id/ivReceipt"
android:layout_width="21dp"
android:layout_height="21dp"
android:layout_marginStart="6dp"
android:src="@drawable/baseline_playlist_add_check_24"
app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintTop_toTopOf="@+id/tvFolder" />
<ImageView
android:id="@+id/ivAttachments"
android:layout_width="21dp"
@ -177,7 +187,7 @@
android:layout_marginStart="6dp"
android:src="@drawable/baseline_attachment_24"
app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintStart_toEndOf="@id/ivReceipt"
app:layout_constraintTop_toTopOf="@+id/tvFolder" />
<TextView

@ -505,6 +505,7 @@
<string name="title_legend_snoozed">Is snoozed</string>
<string name="title_legend_browsed">Is browsed or searched</string>
<string name="title_legend_answered">Has been answered</string>
<string name="title_legend_receipt">Receipt was requested</string>
<string name="title_legend_attachment">Has attachment</string>
<string name="title_legend_flagged">Is starred</string>
<string name="title_legend_contacts">Manage contacts</string>

Loading…
Cancel
Save