mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 03:15:39 +01:00
Enable notification/delete when leave on server is enabled
This commit is contained in:
@@ -57,6 +57,7 @@ public class ServiceUI extends IntentService {
|
||||
static final int PI_HIDE = 9;
|
||||
static final int PI_SNOOZE = 10;
|
||||
static final int PI_IGNORED = 11;
|
||||
static final int PI_DELETE = 12;
|
||||
|
||||
public ServiceUI() {
|
||||
this(ServiceUI.class.getName());
|
||||
@@ -108,6 +109,11 @@ public class ServiceUI extends IntentService {
|
||||
onMove(id, EntityFolder.TRASH);
|
||||
break;
|
||||
|
||||
case "delete":
|
||||
cancel(group, id);
|
||||
onDelete(id);
|
||||
break;
|
||||
|
||||
case "junk":
|
||||
cancel(group, id);
|
||||
onJunk(id);
|
||||
@@ -249,6 +255,23 @@ public class ServiceUI extends IntentService {
|
||||
}
|
||||
}
|
||||
|
||||
private void onDelete(long id) {
|
||||
DB db = DB.getInstance(this);
|
||||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
EntityMessage message = db.message().getMessage(id);
|
||||
if (message == null)
|
||||
return;
|
||||
|
||||
EntityOperation.queue(this, message, EntityOperation.DELETE);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
private void onJunk(long id) throws JSONException {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
boolean block_sender = prefs.getBoolean("notify_block_sender", false);
|
||||
|
||||
Reference in New Issue
Block a user