|
|
|
@ -679,6 +679,17 @@ public class EntityRule {
|
|
|
|
|
create = create.replace("$domain$", domain == null ? "" : domain);
|
|
|
|
|
|
|
|
|
|
if (create.contains("$group$")) {
|
|
|
|
|
EntityContact local = null;
|
|
|
|
|
if (message.from != null && message.from.length == 1) {
|
|
|
|
|
String email = ((InternetAddress) message.from[0]).getAddress();
|
|
|
|
|
if (!TextUtils.isEmpty(email))
|
|
|
|
|
local = db.contact().getContact(message.account, EntityContact.TYPE_FROM, email);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (local != null && !TextUtils.isEmpty(local.group)) {
|
|
|
|
|
Log.i(this.name + " local group=" + local.group);
|
|
|
|
|
create = create.replace("$group$", local.group);
|
|
|
|
|
} else {
|
|
|
|
|
if (!Helper.hasPermission(context, Manifest.permission.READ_CONTACTS))
|
|
|
|
|
return false;
|
|
|
|
|
Log.i(this.name + " lookup=" + message.avatar);
|
|
|
|
@ -738,6 +749,7 @@ public class EntityRule {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String name = folder.name + (folder.separator == null ? "" : folder.separator) + create;
|
|
|
|
|
EntityFolder created = db.folder().getFolderByName(folder.account, name);
|
|
|
|
|