ABContact.m 811 B

123456789101112131415161718192021222324252627
  1. /**
  2. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: GPL-3.0-or-later
  4. */
  5. #import "ABContact.h"
  6. @implementation ABContact
  7. + (instancetype)contactWithIdentifier:(NSString *)identifier name:(NSString *)name phoneNumbers:(NSArray *)phoneNumbers lastUpdate:(NSInteger)lastUpdate
  8. {
  9. ABContact *contact = [[ABContact alloc] init];
  10. contact.identifier = identifier;
  11. contact.name = name;
  12. contact.phoneNumbers = (RLMArray<RLMString> *)phoneNumbers;
  13. contact.lastUpdate = lastUpdate;
  14. return contact;
  15. }
  16. + (void)updateContact:(ABContact *)managedContact withContact:(ABContact *)contact
  17. {
  18. managedContact.name = contact.name;
  19. managedContact.phoneNumbers = contact.phoneNumbers;
  20. managedContact.lastUpdate = contact.lastUpdate;
  21. }
  22. @end