|
|
@ -2149,6 +2149,41 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
.putExtra("id", data.message.id));
|
|
|
|
.putExtra("id", data.message.id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void onMenuResync(ActionData data) {
|
|
|
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
|
|
|
args.putLong("id", data.message.id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected Void onExecute(Context context, Bundle args) {
|
|
|
|
|
|
|
|
long id = args.getLong("id");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
db.beginTransaction();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EntityMessage message = db.message().getMessage(id);
|
|
|
|
|
|
|
|
if (message == null || message.uid == null)
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
db.message().deleteMessage(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EntityOperation.sync(context, message.folder, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
db.setTransactionSuccessful();
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
db.endTransaction();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
|
|
|
Helper.unexpectedError(context, owner, ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}.execute(context, owner, args, "message:share");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void onMenuCreateRule(ActionData data) {
|
|
|
|
private void onMenuCreateRule(ActionData data) {
|
|
|
|
Intent rule = new Intent(ActivityView.ACTION_EDIT_RULE);
|
|
|
|
Intent rule = new Intent(ActivityView.ACTION_EDIT_RULE);
|
|
|
|
rule.putExtra("account", data.message.account);
|
|
|
|
rule.putExtra("account", data.message.account);
|
|
|
@ -2535,6 +2570,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_decrypt).setEnabled(
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_decrypt).setEnabled(
|
|
|
|
data.message.content && data.message.to != null && data.message.to.length > 0);
|
|
|
|
data.message.content && data.message.to != null && data.message.to.length > 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_resync).setEnabled(data.message.uid != null);
|
|
|
|
|
|
|
|
|
|
|
|
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
|
|
|
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean onMenuItemClick(MenuItem target) {
|
|
|
|
public boolean onMenuItemClick(MenuItem target) {
|
|
|
@ -2561,6 +2598,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
case R.id.menu_decrypt:
|
|
|
|
case R.id.menu_decrypt:
|
|
|
|
onMenuDecrypt(data);
|
|
|
|
onMenuDecrypt(data);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case R.id.menu_resync:
|
|
|
|
|
|
|
|
onMenuResync(data);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
case R.id.menu_create_rule:
|
|
|
|
case R.id.menu_create_rule:
|
|
|
|
onMenuCreateRule(data);
|
|
|
|
onMenuCreateRule(data);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|