mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-28 08:32:16 +01:00
Allow subscribing to folders
This commit is contained in:
@@ -83,7 +83,7 @@ public class EntityOperation {
|
||||
static final String BODY = "body";
|
||||
static final String ATTACHMENT = "attachment";
|
||||
static final String SYNC = "sync";
|
||||
static final String WAIT = "wait";
|
||||
static final String SUBSCRIBE = "subscribe";
|
||||
|
||||
static void queue(Context context, DB db, EntityMessage message, String name, Object... values) {
|
||||
JSONArray jargs = new JSONArray();
|
||||
@@ -256,6 +256,26 @@ public class EntityOperation {
|
||||
ServiceSynchronize.process(context);
|
||||
}
|
||||
|
||||
static void subscribe(Context context, long fid, boolean subscribe) {
|
||||
DB db = DB.getInstance(context);
|
||||
|
||||
EntityFolder folder = db.folder().getFolder(fid);
|
||||
|
||||
JSONArray jargs = new JSONArray();
|
||||
jargs.put(subscribe);
|
||||
|
||||
EntityOperation operation = new EntityOperation();
|
||||
operation.account = folder.account;
|
||||
operation.folder = folder.id;
|
||||
operation.message = null;
|
||||
operation.name = SUBSCRIBE;
|
||||
operation.args = jargs.toString();
|
||||
operation.created = new Date().getTime();
|
||||
operation.id = db.operation().insertOperation(operation);
|
||||
|
||||
Log.i("Queued subscribe=" + subscribe + " folder=" + folder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof EntityOperation) {
|
||||
|
||||
Reference in New Issue
Block a user