|
|
@ -1451,6 +1451,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
args.putString("type", type);
|
|
|
|
args.putString("type", type);
|
|
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onPostExecute(Bundle args) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null) {
|
|
|
|
|
|
|
|
boolean force = args.getBoolean("force");
|
|
|
|
|
|
|
|
if (force)
|
|
|
|
|
|
|
|
ServiceSynchronize.reload(context, null, true, "refresh");
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "refresh");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected Void onExecute(Context context, Bundle args) {
|
|
|
|
protected Void onExecute(Context context, Bundle args) {
|
|
|
|
long fid = args.getLong("folder");
|
|
|
|
long fid = args.getLong("folder");
|
|
|
@ -1502,10 +1515,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (force)
|
|
|
|
args.putBoolean("force", force);
|
|
|
|
ServiceSynchronize.reload(context, null, true, "refresh");
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "refresh");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!now)
|
|
|
|
if (!now)
|
|
|
|
throw new IllegalArgumentException(context.getString(R.string.title_no_connection));
|
|
|
|
throw new IllegalArgumentException(context.getString(R.string.title_no_connection));
|
|
|
@ -2965,11 +2975,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "seen");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "seen");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
@ -3104,11 +3119,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "flag");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "flag");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
@ -3677,8 +3697,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "outbox/drafts");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
|
|
|
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
|
|
|
nm.cancel("send:" + id, 1);
|
|
|
|
nm.cancel("send:" + id, 1);
|
|
|
|
|
|
|
|
|
|
|
@ -3687,12 +3705,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onExecuted(Bundle args, EntityMessage draft) {
|
|
|
|
protected void onExecuted(Bundle args, EntityMessage draft) {
|
|
|
|
if (draft != null)
|
|
|
|
if (draft != null) {
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "outbox/drafts");
|
|
|
|
context.startActivity(
|
|
|
|
context.startActivity(
|
|
|
|
new Intent(context, ActivityCompose.class)
|
|
|
|
new Intent(context, ActivityCompose.class)
|
|
|
|
.putExtra("action", "edit")
|
|
|
|
.putExtra("action", "edit")
|
|
|
|
.putExtra("id", draft.id));
|
|
|
|
.putExtra("id", draft.id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
@ -5196,11 +5216,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "expand");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "expand");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
@ -5395,13 +5420,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "move");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "move");
|
|
|
|
|
|
|
|
|
|
|
|
if (viewType == AdapterMessage.ViewType.THREAD) {
|
|
|
|
if (viewType == AdapterMessage.ViewType.THREAD) {
|
|
|
|
PagedList<TupleMessageEx> messages = adapter.getCurrentList();
|
|
|
|
PagedList<TupleMessageEx> messages = adapter.getCurrentList();
|
|
|
|
if (messages != null && result.size() > 0) {
|
|
|
|
if (messages != null && result.size() > 0) {
|
|
|
@ -5492,11 +5519,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "move");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "move");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
Log.e(ex);
|
|
|
|
Log.e(ex);
|
|
|
@ -7166,8 +7198,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "delete");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
|
|
|
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
|
|
|
nm.cancel("send:" + id, 1);
|
|
|
|
nm.cancel("send:" + id, 1);
|
|
|
|
|
|
|
|
|
|
|
@ -7176,6 +7206,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "delete");
|
|
|
|
|
|
|
|
|
|
|
|
if (viewType == AdapterMessage.ViewType.THREAD) {
|
|
|
|
if (viewType == AdapterMessage.ViewType.THREAD) {
|
|
|
|
PagedList<TupleMessageEx> messages = adapter.getCurrentList();
|
|
|
|
PagedList<TupleMessageEx> messages = adapter.getCurrentList();
|
|
|
|
if (messages != null) {
|
|
|
|
if (messages != null) {
|
|
|
@ -7218,13 +7252,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "delete");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "delete");
|
|
|
|
|
|
|
|
|
|
|
|
if (viewType == AdapterMessage.ViewType.THREAD) {
|
|
|
|
if (viewType == AdapterMessage.ViewType.THREAD) {
|
|
|
|
long[] ids = args.getLongArray("ids");
|
|
|
|
long[] ids = args.getLongArray("ids");
|
|
|
|
PagedList<TupleMessageEx> messages = adapter.getCurrentList();
|
|
|
|
PagedList<TupleMessageEx> messages = adapter.getCurrentList();
|
|
|
@ -7286,11 +7322,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "junk");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "junk");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
if (ex instanceof IllegalArgumentException) {
|
|
|
|
if (ex instanceof IllegalArgumentException) {
|
|
|
@ -7357,11 +7398,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "flag");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "flag");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
@ -7542,18 +7588,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (copy)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "copy");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) {
|
|
|
|
protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) {
|
|
|
|
boolean copy = args.getBoolean("copy");
|
|
|
|
boolean copy = args.getBoolean("copy");
|
|
|
|
if (copy)
|
|
|
|
if (copy) {
|
|
|
|
ToastEx.makeText(getContext(), R.string.title_completed, Toast.LENGTH_LONG).show();
|
|
|
|
Context context = getContext();
|
|
|
|
else
|
|
|
|
if (context != null) {
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "copy");
|
|
|
|
|
|
|
|
ToastEx.makeText(context, R.string.title_completed, Toast.LENGTH_LONG).show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else
|
|
|
|
moveAsk(result, false, !autoclose && onclose == null);
|
|
|
|
moveAsk(result, false, !autoclose && onclose == null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -7866,11 +7913,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
db.endTransaction();
|
|
|
|
db.endTransaction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "purge");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
Context context = getContext();
|
|
|
|
|
|
|
|
if (context != null)
|
|
|
|
|
|
|
|
ServiceSynchronize.eval(context, "purge");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|