From 05f453b67bca0603b8e8de45eb0cd1a5a44e644b Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 9 Feb 2021 17:39:11 +0100 Subject: [PATCH] Set/reset Gmail specific starred label --- app/src/main/java/eu/faircode/email/Core.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 29ddb82a7f..1d375edb63 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -704,7 +704,7 @@ class Core { db.message().setMessageUiSeen(folder.id, seen); } - private static void onFlag(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPFolder ifolder) throws MessagingException, JSONException { + private static void onFlag(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPFolder ifolder) throws MessagingException, JSONException, IOException { // Star/unstar message DB db = DB.getInstance(context); @@ -723,6 +723,8 @@ class Core { throw new MessageRemovedException(); imessage.setFlag(Flags.Flag.FLAGGED, flagged); + if (imessage instanceof GmailMessage) + ((GmailMessage) imessage).setLabels(new String[]{"\\Starred"}, flagged); db.message().setMessageFlagged(message.id, flagged); }