Added contact group to vCard import/export

This commit is contained in:
M66B
2022-03-27 11:06:19 +02:00
parent 0e107b0f76
commit 43f26cac88
2 changed files with 16 additions and 0 deletions

View File

@@ -168,6 +168,10 @@ public class EntityContact implements Serializable {
}
public static void update(Context context, long account, Address[] addresses, int type, long time) {
update(context, account, addresses, null, type, time);
}
public static void update(Context context, long account, Address[] addresses, String group, int type, long time) {
if (addresses == null)
return;
@@ -192,6 +196,7 @@ public class EntityContact implements Serializable {
contact.type = type;
contact.email = email;
contact.name = name;
contact.group = group;
contact.avatar = (avatar == null ? null : avatar.toString());
contact.times_contacted = 1;
contact.first_contacted = time;
@@ -201,6 +206,8 @@ public class EntityContact implements Serializable {
} else {
if (contact.name == null && name != null)
contact.name = name;
if (contact.group == null && group != null)
contact.group = group;
contact.avatar = (avatar == null ? null : avatar.toString());
contact.times_contacted++;
contact.first_contacted = Math.min(contact.first_contacted, time);