Skip to content

Commit

Permalink
Merged fork by Stephan Burlot. Now displays 'Call forward number' in …
Browse files Browse the repository at this point in the history
…Phone, as well as all email addresses for an account, not only the first one.
  • Loading branch information
nst committed Dec 27, 2009
1 parent 0cfe437 commit a6e6113
Show file tree
Hide file tree
Showing 12 changed files with 1,006 additions and 738 deletions.
2 changes: 1 addition & 1 deletion Classes/SPEmailASAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ + (SPEmailAccount *)accountWithDictionary:(NSDictionary *)d {

account.type = [d valueForKey:@"Short Type String"];
//account.fullname = nil;
account.email = [NSArray arrayWithObject:[d valueForKey:@"ASAccountEmailAddress"]];
account.emails = [NSArray arrayWithObject:[d valueForKey:@"ASAccountEmailAddress"]];
account.hostname = [d valueForKey:@"ASAccountHost"];
account.username = [d valueForKey:@"ASAccountUsername"];
account.displayName = [d valueForKey:@"DisplayName"];
Expand Down
4 changes: 2 additions & 2 deletions Classes/SPEmailAccount.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

@interface SPEmailAccount : NSObject {
NSString *fullname;
NSArray *email;
NSArray *emails;
NSString *type;
NSString *hostname;
NSString *username;
NSString *displayName;
}

@property (nonatomic, retain) NSString *fullname;
@property (nonatomic, retain) NSArray *email;
@property (nonatomic, retain) NSArray *emails;
@property (nonatomic, retain) NSString *type;
@property (nonatomic, retain) NSString *hostname;
@property (nonatomic, retain) NSString *username;
Expand Down
8 changes: 4 additions & 4 deletions Classes/SPEmailAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
@implementation SPEmailAccount

@synthesize fullname;
@synthesize email;
@synthesize emails;
@synthesize type;
@synthesize hostname;
@synthesize username;
@synthesize displayName;

- (void)dealloc {
[fullname release];
[email release];
[emails release];
[type release];
[hostname release];
[username release];
Expand All @@ -40,8 +40,8 @@ - (NSArray *)infoArray {
if(type) [a addObject:[NSString stringWithFormat:@"Type: %@", type]];
if(hostname) [a addObject:[NSString stringWithFormat:@"Host: %@", hostname]];
if(username) [a addObject:[NSString stringWithFormat:@"User: %@", username]];
if(email) {
for (id emailAddress in email)
if(emails) {
for (id emailAddress in emails)
[a addObject:[NSString stringWithFormat:@"Email: %@", emailAddress]];
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/SPEmailGmailAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ + (SPEmailAccount *)accountWithDictionary:(NSDictionary *)d {
if(![[theEmail lowercaseString] hasSuffix:@"@gmail.com"]) {
theEmail = [theEmail stringByAppendingString:@"@gmail.com"];
}
account.email = [NSArray arrayWithObject:theEmail];
account.emails = [NSArray arrayWithObject:theEmail];

return [account autorelease];
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/SPEmailIMAPAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ + (SPEmailAccount *)accountWithDictionary:(NSDictionary *)d {

account.type = [d valueForKey:@"Short Type String"];
account.fullname = [d valueForKey:@"FullUserName"];
account.email = [d valueForKey:@"EmailAddresses"];
account.emails = [d valueForKey:@"EmailAddresses"];
account.hostname = [d valueForKey:@"Hostname"];
account.username = [d valueForKey:@"Username"];
account.displayName = [d valueForKey:@"DisplayName"];
Expand Down
9 changes: 4 additions & 5 deletions Classes/SPEmailIToolsAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ + (SPEmailAccount *)accountWithDictionary:(NSDictionary *)d {
account.type = [d valueForKey:@"Short Type String"];
account.fullname = [d valueForKey:@"FullUserName"];
NSArray *theEmailAddresses = [d valueForKey:@"EmailAddresses"];
NSMutableArray *a = [NSMutableArray array];
if(theEmailAddresses) {
for (id emailAddress in theEmailAddresses)
[a addObject:[NSString stringWithFormat:@"%@@me.com", emailAddress]];
NSMutableArray *theEmails = [NSMutableArray array];
for (id emailAddress in theEmailAddresses) {
[theEmails addObject:[NSString stringWithFormat:@"%@@me.com", emailAddress]];
}
account.email = a;
account.emails = theEmails;
//account.hostname = nil;
account.username = [d valueForKey:@"Username"];
account.displayName = [d valueForKey:@"DisplayName"];
Expand Down
2 changes: 1 addition & 1 deletion Classes/SPEmailPOPAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ + (SPEmailAccount *)accountWithDictionary:(NSDictionary *)d {

account.type = [d valueForKey:@"Short Type String"];
account.fullname = [d valueForKey:@"FullUserName"];
account.email = [d valueForKey:@"EmailAddresses"];
account.emails = [d valueForKey:@"EmailAddresses"];
account.hostname = [d valueForKey:@"Hostname"];
account.username = [d valueForKey:@"Username"];
account.displayName = [d valueForKey:@"DisplayName"];
Expand Down
4 changes: 2 additions & 2 deletions Classes/SPSourceEmailTVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ - (void)loadData {
}

for(SPEmailAccount *account in accountsFound) {
if(!account.email) continue;
[emails addObject:account.email];
if(!account.emails) continue;
[emails addObjectsFromArray:account.emails];
[contentsDictionaries addObject:[NSDictionary dictionaryWithObject:[account infoArray] forKey:account.displayName]];
}
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/SPSourceLocationTVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ - (void)loadData {
NSString *path = @"/var/mobile/Library/Preferences/com.apple.Maps.plist";
NSDictionary *d = [NSDictionary dictionaryWithContentsOfFile:path];
NSData *data = [d valueForKey:@"UserLocation"];
CLLocation *loc = [NSKeyedUnarchiver unarchiveObjectWithData:data];
CLLocation *loc = data ? [NSKeyedUnarchiver unarchiveObjectWithData:data] : nil;
self.locString = @"";
self.locDateString = @"";
if(loc) {
Expand Down
4 changes: 3 additions & 1 deletion Classes/SPSourcePhoneTVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ - (void)loadData {
*/
path = @"/var/mobile/Library/Preferences/com.apple.mobilephone.settings.plist";
d = [NSDictionary dictionaryWithContentsOfFile:path];
self.lastForwardNumber = [NSString stringWithFormat:@"%@", [d valueForKey:@"call-forwarding-number"]];

NSString *callForwardingNumber = [d valueForKey:@"call-forwarding-number"];
self.lastForwardNumber = callForwardingNumber ? [NSString stringWithFormat:@"%@", callForwardingNumber] : nil;

path = @"/var/mobile/Library/Preferences/com.apple.mobilephone.plist";
d = [NSDictionary dictionaryWithContentsOfFile:path];
Expand Down
Loading

0 comments on commit a6e6113

Please sign in to comment.