From 75271c67ae9b970d4945aa97bb21f1c8af6e0624 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 14 Apr 2016 18:51:10 -0700 Subject: Changing the ID used by CCBUser to support the migration from F1 to CCB --- src/main/java/com/p4square/grow/ccb/CCBUser.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/p4square/grow') diff --git a/src/main/java/com/p4square/grow/ccb/CCBUser.java b/src/main/java/com/p4square/grow/ccb/CCBUser.java index 7313172..fcd1593 100644 --- a/src/main/java/com/p4square/grow/ccb/CCBUser.java +++ b/src/main/java/com/p4square/grow/ccb/CCBUser.java @@ -22,7 +22,13 @@ public class CCBUser extends User { public CCBUser(final IndividualProfile profile) { mProfile = profile; - setIdentifier("CCB-" + mProfile.getId()); + // The identifier is set to the syncId if present, otherwise the CCB Id is used with the prefix CCB-. + final int syncId = mProfile.getSyncId(); + if (syncId > 0) { + setIdentifier(String.valueOf(syncId)); + } else { + setIdentifier("CCB-" + mProfile.getId()); + } setFirstName(mProfile.getFirstName()); setLastName(mProfile.getLastName()); setEmail(mProfile.getEmail()); -- cgit v1.2.3