|
|
@ -166,6 +166,7 @@ class Core {
|
|
|
|
|
|
|
|
|
|
|
|
if (message == null) {
|
|
|
|
if (message == null) {
|
|
|
|
if (!EntityOperation.FETCH.equals(op.name) &&
|
|
|
|
if (!EntityOperation.FETCH.equals(op.name) &&
|
|
|
|
|
|
|
|
!EntityOperation.DELETED.equals(op.name) &&
|
|
|
|
!EntityOperation.SYNC.equals(op.name) &&
|
|
|
|
!EntityOperation.SYNC.equals(op.name) &&
|
|
|
|
!EntityOperation.SUBSCRIBE.equals(op.name))
|
|
|
|
!EntityOperation.SUBSCRIBE.equals(op.name))
|
|
|
|
throw new MessageRemovedException();
|
|
|
|
throw new MessageRemovedException();
|
|
|
@ -221,6 +222,10 @@ class Core {
|
|
|
|
onDelete(context, jargs, folder, message, (IMAPFolder) ifolder);
|
|
|
|
onDelete(context, jargs, folder, message, (IMAPFolder) ifolder);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case EntityOperation.DELETED:
|
|
|
|
|
|
|
|
onDeleted(context, jargs, folder, (IMAPFolder) ifolder);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case EntityOperation.HEADERS:
|
|
|
|
case EntityOperation.HEADERS:
|
|
|
|
onHeaders(context, jargs, folder, message, (IMAPFolder) ifolder);
|
|
|
|
onHeaders(context, jargs, folder, message, (IMAPFolder) ifolder);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -327,10 +332,14 @@ class Core {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
if (EntityOperation.ADD.equals(op.name))
|
|
|
|
if (EntityOperation.ADD.equals(op.name))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (EntityOperation.FETCH.equals(op.name))
|
|
|
|
|
|
|
|
return;
|
|
|
|
if (EntityOperation.EXISTS.equals(op.name))
|
|
|
|
if (EntityOperation.EXISTS.equals(op.name))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
if (EntityOperation.DELETE.equals(op.name) && !TextUtils.isEmpty(message.msgid))
|
|
|
|
if (EntityOperation.DELETE.equals(op.name) && !TextUtils.isEmpty(message.msgid))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (EntityOperation.DELETED.equals(op.name))
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
Log.i(folder.name + " ensure uid op=" + op.name + " msgid=" + message.msgid);
|
|
|
|
Log.i(folder.name + " ensure uid op=" + op.name + " msgid=" + message.msgid);
|
|
|
|
|
|
|
|
|
|
|
@ -743,6 +752,18 @@ class Core {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void onDeleted(Context context, JSONArray jargs, EntityFolder folder, IMAPFolder ifolder) throws JSONException, MessagingException, IOException {
|
|
|
|
|
|
|
|
long uid = jargs.getLong(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
db.message().deleteMessage(folder.id, uid);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
int count = ifolder.getMessageCount();
|
|
|
|
|
|
|
|
db.folder().setFolderTotal(folder.id, count < 0 ? null : count);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void onHeaders(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPFolder ifolder) throws MessagingException {
|
|
|
|
private static void onHeaders(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPFolder ifolder) throws MessagingException {
|
|
|
|
// Download headers
|
|
|
|
// Download headers
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|