Refactoring

This commit is contained in:
M66B
2020-06-25 18:32:28 +02:00
parent b04ce74069
commit 1488a37caa
2 changed files with 12 additions and 9 deletions

View File

@@ -244,6 +244,16 @@ public class EntityMessage implements Serializable {
return "notification." + sender.getAddress().toLowerCase(Locale.ROOT);
}
void setLabel(String label, boolean set) {
List<String> list = new ArrayList<>();
if (labels != null)
list.addAll(Arrays.asList(labels));
list.remove(label);
if (set)
list.add(label);
labels = list.toArray(new String[0]);
}
static File getFile(Context context, Long id) {
File dir = new File(context.getFilesDir(), "messages");
if (!dir.exists())