mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-25 17:27:00 +00:00
Preset new folder keywords
This commit is contained in:
parent
56e8c6111a
commit
4b3b4781f0
1 changed files with 13 additions and 0 deletions
|
@ -169,6 +169,19 @@ public class EntityOperation {
|
|||
message.keywords = keywords.toArray(new String[0]);
|
||||
db.message().setMessageKeywords(message.id, DB.Converters.fromStringArray(message.keywords));
|
||||
|
||||
if (set) {
|
||||
EntityFolder folder = db.folder().getFolder(message.folder);
|
||||
if (folder != null) {
|
||||
List<String> fkeywords = new ArrayList<>();
|
||||
if (folder.keywords != null)
|
||||
fkeywords.addAll(Arrays.asList(folder.keywords));
|
||||
if (!fkeywords.contains(keyword))
|
||||
fkeywords.add(keyword);
|
||||
Collections.sort(fkeywords);
|
||||
db.folder().setFolderKeywords(folder.id, DB.Converters.fromStringArray(message.keywords));
|
||||
}
|
||||
}
|
||||
|
||||
} else if (LABEL.equals(name)) {
|
||||
String label = jargs.getString(0);
|
||||
boolean set = jargs.getBoolean(1);
|
||||
|
|
Loading…
Reference in a new issue