Skip to content

Commit 057c507

Browse files
committed
Removed method +[SSYUserInfo fromAddressBookFirstName_p:::] because I have not used it for years, and it requires the depracated AddressBook framework.
1 parent 4efa11e commit 057c507

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

SSYUserInfo.h

-14
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,6 @@ extern NSInteger const SSYUserInfoCouldNotGetLoginTimeError;
99
__attribute__((visibility("default"))) @interface SSYUserInfo : NSObject {
1010
}
1111

12-
/*!
13-
@brief Returns first name, last name and primary email
14-
address of from the "me" entry in Address Book.
15-
16-
@details Warning! Starting with macOS 10.8, invoking
17-
this method will produce an ugly, scary and vague dialog box
18-
asking the user if it is OK for your app to access their
19-
Contacts. This method will block until the dialog is
20-
dismissed by the user.
21-
*/
22-
+ (void)fromAddressBookFirstName_p:(NSString**)ptrFirstName
23-
lastName_p:(NSString**)ptrLastName
24-
email_p:(NSString**)ptrEmail ;
25-
2612
/*!
2713
@brief Returns the string name, unix user ID (uid) and
2814
unix group ID (id) of the current console user.

SSYUserInfo.m

-34
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#import "SSYUserInfo.h"
22
#import <SystemConfiguration/SCDynamicStoreCopySpecific.h>
3-
#import <AddressBook/ABAddressBook.h>
4-
#import <AddressBook/ABMultiValue.h>
53
#import <utmpx.h>
64
#import <string.h>
75

@@ -10,38 +8,6 @@
108

119
@implementation SSYUserInfo
1210

13-
+ (void)fromAddressBookFirstName_p:(NSString**)ptrFirstName
14-
lastName_p:(NSString**)ptrLastName
15-
email_p:(NSString**)ptrEmail {
16-
ABPerson* me = [[ABAddressBook sharedAddressBook] me] ;
17-
18-
if (ptrEmail) {
19-
ABMultiValue *emails = [me valueForProperty:kABEmailProperty];
20-
*ptrEmail = nil ;
21-
NSString* emailIdentifier = [emails primaryIdentifier] ;
22-
if (emailIdentifier) {
23-
*ptrEmail = [emails valueAtIndex:[emails indexForIdentifier:emailIdentifier]];
24-
}
25-
if (!(*ptrEmail)) {
26-
*ptrEmail = @"" ;
27-
}
28-
}
29-
30-
if (ptrFirstName) {
31-
*ptrFirstName = [me valueForProperty:kABFirstNameProperty];
32-
if (!(*ptrFirstName)) {
33-
*ptrFirstName = @"" ;
34-
}
35-
}
36-
37-
if (ptrLastName) {
38-
*ptrLastName = [me valueForProperty:kABLastNameProperty];
39-
if (!(*ptrLastName)) {
40-
*ptrLastName = @"" ;
41-
}
42-
}
43-
}
44-
4511
+ (NSString*)consoleUserNameAndUid_p:(uid_t*)uid_p
4612
gid_p:(gid_t*)gid_p {
4713
NSString* name = (NSString*)SCDynamicStoreCopyConsoleUser(NULL, uid_p, gid_p) ;

0 commit comments

Comments
 (0)