Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(ContactUtils.isContactExisting(fullName) === true) {
  2.                     //Commented out update
  3.                     /*Logger.debug("[Connection] Person exist on contacts");                                                       
  4.                     //update contact                                   
  5.                     ContactUtils.updateContact({                       
  6.                         firstName: profiles[i].firstName,
  7.                         lastName: profiles[i].lastName,
  8.                         fullName: fullName,
  9.                         image: profilePic.read(),
  10.                         jobTitle: profiles[i].jobTitle,
  11.                         phoneNumber: numbers[0],
  12.                         workNumber: numbers[1] ? numbers[1] : "",
  13.                         homeNumber: numbers[2] ? numbers[2] : "",
  14.                         emailAddress: profiles[i].emails,
  15.                         homeAddress: profiles[i].homeAddress,
  16.                         workAddress: profiles[i].workAddress,
  17.                         skype: profiles[i].skype,
  18.                         twitter: profiles[i].twitter,
  19.                         url: profiles[i].website,
  20.                         company: profiles[i].company,          
  21.                         notes: profiles[i].notes
  22.                     });
  23.                    
  24.                     Logger.debug("[Connection] Successfully updated on address book.");
  25.                     isAddressBookUpdated = true;
  26.                     */             
  27.                 }
  28.                 else {
  29.                     Logger.debug("[Connection] Person doesn't exist on contacts. Creating a new one");                                                 
  30.                     //create new contact                                       
  31.                    
  32.                     ContactUtils.createContact({                       
  33.                         firstName: profiles[i].firstName,
  34.                         lastName: profiles[i].lastName,
  35.                         fullName: fullName,
  36.                         image: profilePic.read(),
  37.                         phoneNumber: numbers[i],
  38.                         workNumber: numbers[1] ? numbers[1] : "",
  39.                         homeNumber: numbers[2] ? numbers[2] : "",
  40.                         emailAddress: profiles[i].emails,
  41.                         homeAddress: profiles[i].homeAddress,
  42.                         workAddress: profiles[i].workAddress,
  43.                         skype: profiles[i].skype,
  44.                         twitter: profiles[i].twitter,
  45.                         url: profiles[i].website,
  46.                         company: profiles[i].company,          
  47.                         notes: profiles[i].notes
  48.                     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement