summaryrefslogtreecommitdiff
path: root/src/main/java/com/p4square/grow
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2016-04-14 18:51:10 -0700
committerJesse Morgan <jesse@jesterpm.net>2016-04-14 18:51:10 -0700
commit75271c67ae9b970d4945aa97bb21f1c8af6e0624 (patch)
treefc8b6e3b89a15ef5b03b5a083c016a6834cba891 /src/main/java/com/p4square/grow
parent371ccae3d1f31ec38f4af77fb7fcd175d49b3cd5 (diff)
Changing the ID used by CCBUser to support the migration from F1 to CCB20160414
Diffstat (limited to 'src/main/java/com/p4square/grow')
-rw-r--r--src/main/java/com/p4square/grow/ccb/CCBUser.java8
1 files changed, 7 insertions, 1 deletions
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());