cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject cordova-plugin-contacts git commit: CB-3950 Adds support for custom labels
Date Fri, 27 Nov 2015 10:12:17 GMT
Repository: cordova-plugin-contacts
Updated Branches:
  refs/heads/master 617fb764b -> a4599c250


CB-3950 Adds support for custom labels


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/a4599c25
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/a4599c25
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/a4599c25

Branch: refs/heads/master
Commit: a4599c250c459c190542231047e27e7cbfe0bbcb
Parents: 617fb76
Author: Vladimir Kotikov <v-vlkoti@microsoft.com>
Authored: Thu Nov 26 16:40:28 2015 +0300
Committer: Vladimir Kotikov <v-vlkoti@microsoft.com>
Committed: Fri Nov 27 13:11:27 2015 +0300

----------------------------------------------------------------------
 src/ios/CDVContact.m | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/a4599c25/src/ios/CDVContact.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVContact.m b/src/ios/CDVContact.m
index 8a91ca6..0149a92 100644
--- a/src/ios/CDVContact.m
+++ b/src/ios/CDVContact.m
@@ -750,7 +750,9 @@ static NSDictionary* org_apache_cordova_contacts_defaultFields = nil;
     } else if ([label caseInsensitiveCompare:kW3ContactUrlProfile] == NSOrderedSame) {
         type = kABPersonHomePageLabel;
     } else {
-        type = kABOtherLabel;
+        // CB-3950 If label is not one of kW3*Label constants, threat it as custom label,
+        // otherwise fetching contact and then saving it will break this label in address
book.
+        type = (__bridge CFStringRef)(label);
     }
 
     return type;
@@ -787,7 +789,9 @@ static NSDictionary* org_apache_cordova_contacts_defaultFields = nil;
         } else if ([label isEqualToString:(NSString*)kABPersonHomePageLabel]) {
             type = kW3ContactUrlProfile;
         } else {
-            type = kW3ContactOtherLabel;
+            // CB-3950 If label is not one of kW3*Label constants, threat it as custom label,
+            // otherwise fetching contact and then saving it will break this label in address
book.
+            type = label;
         }
     }
     return type;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message