|
|
@ -708,17 +708,10 @@ class Core {
|
|
|
|
((GmailMessage) imessage).setLabels(new String[]{label}, set);
|
|
|
|
((GmailMessage) imessage).setLabels(new String[]{label}, set);
|
|
|
|
|
|
|
|
|
|
|
|
// Gmail does not push label changes
|
|
|
|
// Gmail does not push label changes
|
|
|
|
|
|
|
|
message.setLabel(label, set);
|
|
|
|
List<String> labels = new ArrayList<>();
|
|
|
|
|
|
|
|
if (message.labels != null)
|
|
|
|
|
|
|
|
labels.addAll(Arrays.asList(message.labels));
|
|
|
|
|
|
|
|
labels.remove(label);
|
|
|
|
|
|
|
|
if (set)
|
|
|
|
|
|
|
|
labels.add(label);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
db.message().setMessageLabels(message.id,
|
|
|
|
db.message().setMessageLabels(message.id, DB.Converters.fromStringArray(message.labels));
|
|
|
|
DB.Converters.fromStringArray(labels.toArray(new String[0])));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void onAdd(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPStore istore, IMAPFolder ifolder, State state) throws MessagingException, IOException {
|
|
|
|
private static void onAdd(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPStore istore, IMAPFolder ifolder, State state) throws MessagingException, IOException {
|
|
|
|