1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 17:57:16 +00:00

Improved folder flags update

This commit is contained in:
M66B 2018-11-26 15:34:07 +01:00
parent ac2c156239
commit c3e945bea2

View file

@ -845,11 +845,7 @@ public class ServiceSynchronize extends LifecycleService {
db.folder().setFolderState(folder.id, "connected");
db.folder().setFolderError(folder.id, null);
List<String> keywords = new ArrayList<>();
for (String keyword : ifolder.getPermanentFlags().getUserFlags())
keywords.add(keyword);
db.folder().setFolderKeywords(folder.id, DB.Converters.fromStringArray(keywords.toArray(new String[0])));
db.folder().setFolderKeywords(folder.id, DB.Converters.fromStringArray(ifolder.getPermanentFlags().getUserFlags()));
Log.i(Helper.TAG, account.name + " folder " + folder.name + " flags=" + ifolder.getPermanentFlags());
@ -1516,6 +1512,8 @@ public class ServiceSynchronize extends LifecycleService {
} else
keywords.remove(keyword);
db.message().setMessageKeywords(message.id, DB.Converters.fromStringArray(keywords.toArray(new String[0])));
db.folder().setFolderKeywords(folder.id, DB.Converters.fromStringArray(ifolder.getPermanentFlags().getUserFlags()));
}
private void doAdd(EntityFolder folder, Session isession, IMAPFolder ifolder, EntityMessage message, JSONArray jargs, DB db) throws MessagingException, JSONException, IOException {