Check possible notification actions

pull/160/head
M66B 6 years ago
parent d6b9ceb388
commit e642c378f2

@ -2218,7 +2218,10 @@ class Core {
.setSubText(message.accountName + " · " + folderName); .setSubText(message.accountName + " · " + folderName);
} }
if (notify_trash) { DB db = DB.getInstance(context);
if (notify_trash &&
db.folder().getFolderByType(message.account, EntityFolder.TRASH) != null) {
Intent trash = new Intent(context, ServiceUI.class) Intent trash = new Intent(context, ServiceUI.class)
.setAction("trash:" + message.id) .setAction("trash:" + message.id)
.putExtra("group", group); .putExtra("group", group);
@ -2230,7 +2233,8 @@ class Core {
mbuilder.addAction(actionTrash.build()); mbuilder.addAction(actionTrash.build());
} }
if (notify_archive) { if (notify_archive &&
db.folder().getFolderByType(message.account, EntityFolder.ARCHIVE) != null) {
Intent archive = new Intent(context, ServiceUI.class) Intent archive = new Intent(context, ServiceUI.class)
.setAction("archive:" + message.id) .setAction("archive:" + message.id)
.putExtra("group", group); .putExtra("group", group);
@ -2242,7 +2246,8 @@ class Core {
mbuilder.addAction(actionArchive.build()); mbuilder.addAction(actionArchive.build());
} }
if (notify_reply && message.content) { if (notify_reply && message.content &&
db.identity().getComposableIdentities(message.account).size() > 0) {
Intent reply = new Intent(context, ActivityCompose.class) Intent reply = new Intent(context, ActivityCompose.class)
.putExtra("action", "reply") .putExtra("action", "reply")
.putExtra("reference", message.id); .putExtra("reference", message.id);

Loading…
Cancel
Save