Skip to content
This repository
Browse code

Converted sample projects to latest Xcode project format and converte…

…d files from tabs to spaces
  • Loading branch information...
commit 7c13b7b9518e0bc2cdd86e092245e0e05afa0239 1 parent d6f68a6
Matt Ronge authored May 30, 2012

Showing 46 changed files with 2,157 additions and 2,156 deletions. Show diff stats Hide diff stats

  1. 14  Examples/OSX/InboxLister/InboxLister.xcodeproj/project.pbxproj
  2. 6  Examples/OSX/InboxLister/MyController.h
  3. 80  Examples/OSX/InboxLister/MyController.m
  4. 10  Examples/OSX/MessageSender/MessageSender.xcodeproj/project.pbxproj
  5. 6  Examples/OSX/MessageSender/MyController.h
  6. 62  Examples/OSX/MessageSender/MyController.m
  7. 10  Examples/iOS/MessageSender/MessageSender/ViewController.m
  8. 6  Source/CTBareAttachment.h
  9. 32  Source/CTBareAttachment.m
  10. 4  Source/CTBareMessage.h
  11. 20  Source/CTBareMessage.m
  12. 56  Source/CTCoreAccount.h
  13. 315  Source/CTCoreAccount.m
  14. 30  Source/CTCoreAddress.h
  15. 62  Source/CTCoreAddress.m
  16. 4  Source/CTCoreAttachment.h
  17. 70  Source/CTCoreAttachment.m
  18. 118  Source/CTCoreFolder.h
  19. 982  Source/CTCoreFolder.m
  20. 98  Source/CTCoreMessage.h
  21. 772  Source/CTCoreMessage.m
  22. 6  Source/CTESMTP.h
  23. 130  Source/CTESMTP.m
  24. 4  Source/CTMIME.h
  25. 138  Source/CTMIME.m
  26. 4  Source/CTMIMEFactory.h
  27. 78  Source/CTMIMEFactory.m
  28. 2  Source/CTMIME_Enumerator.h
  29. 70  Source/CTMIME_Enumerator.m
  30. 126  Source/CTMIME_HtmlPart.m
  31. 4  Source/CTMIME_MessagePart.h
  32. 54  Source/CTMIME_MessagePart.m
  33. 2  Source/CTMIME_MultiPart.h
  34. 68  Source/CTMIME_MultiPart.m
  35. 14  Source/CTMIME_SinglePart.h
  36. 220  Source/CTMIME_SinglePart.m
  37. 118  Source/CTMIME_TextPart.m
  38. 8  Source/CTSMTP.h
  39. 66  Source/CTSMTP.m
  40. 110  Source/CTSMTPAsyncConnection.m
  41. 28  Source/CTSMTPConnection.h
  42. 64  Source/CTSMTPConnection.m
  43. 6  Source/MailCoreTypes.h
  44. 2  Source/MailCoreUtilities.h
  45. 64  Source/MailCoreUtilities.m
  46. 170  main.m
14  Examples/OSX/InboxLister/InboxLister.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
3 3
 	archiveVersion = 1;
4 4
 	classes = {
5 5
 	};
6  
-	objectVersion = 42;
  6
+	objectVersion = 46;
7 7
 	objects = {
8 8
 
9 9
 /* Begin PBXBuildFile section */
@@ -87,6 +87,8 @@
87 87
 		080E96DDFE201D6D7F000001 /* Classes */ = {
88 88
 			isa = PBXGroup;
89 89
 			children = (
  90
+				F8FF333D09D272810051FC62 /* MyController.m */,
  91
+				F8FF333C09D272810051FC62 /* MyController.h */,
90 92
 			);
91 93
 			name = Classes;
92 94
 			sourceTree = "<group>";
@@ -136,8 +138,6 @@
136 138
 			children = (
137 139
 				32CA4F630368D1EE00C91783 /* InboxLister_Prefix.pch */,
138 140
 				29B97316FDCFA39411CA2CEA /* main.m */,
139  
-				F8FF333C09D272810051FC62 /* MyController.h */,
140  
-				F8FF333D09D272810051FC62 /* MyController.m */,
141 141
 			);
142 142
 			name = "Other Sources";
143 143
 			sourceTree = "<group>";
@@ -198,8 +198,11 @@
198 198
 /* Begin PBXProject section */
199 199
 		29B97313FDCFA39411CA2CEA /* Project object */ = {
200 200
 			isa = PBXProject;
  201
+			attributes = {
  202
+				LastUpgradeCheck = 0430;
  203
+			};
201 204
 			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "InboxLister" */;
202  
-			compatibilityVersion = "Xcode 2.4";
  205
+			compatibilityVersion = "Xcode 3.2";
203 206
 			developmentRegion = English;
204 207
 			hasScannedForEncodings = 1;
205 208
 			knownRegions = (
@@ -293,7 +296,6 @@
293 296
 			buildSettings = {
294 297
 				COPY_PHASE_STRIP = NO;
295 298
 				GCC_DYNAMIC_NO_PIC = NO;
296  
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
297 299
 				GCC_MODEL_TUNING = G5;
298 300
 				GCC_OPTIMIZATION_LEVEL = 0;
299 301
 				HEADER_SEARCH_PATHS = (
@@ -329,7 +331,6 @@
329 331
 			buildSettings = {
330 332
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
331 333
 				GCC_WARN_UNUSED_VARIABLE = YES;
332  
-				PREBINDING = NO;
333 334
 				SDKROOT = macosx;
334 335
 			};
335 336
 			name = Debug;
@@ -339,7 +340,6 @@
339 340
 			buildSettings = {
340 341
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
341 342
 				GCC_WARN_UNUSED_VARIABLE = YES;
342  
-				PREBINDING = NO;
343 343
 				SDKROOT = macosx;
344 344
 			};
345 345
 			name = Release;
6  Examples/OSX/InboxLister/MyController.h
@@ -9,10 +9,10 @@
9 9
     IBOutlet id port;
10 10
     IBOutlet id server;
11 11
     IBOutlet id username;
12  
-	IBOutlet id useTLS;
  12
+    IBOutlet id useTLS;
13 13
 
14  
-	CTCoreAccount	*myAccount;
15  
-	NSMutableArray	*myMessages;
  14
+    CTCoreAccount	*myAccount;
  15
+    NSMutableArray	*myMessages;
16 16
 }
17 17
 - (IBAction)connect:(id)sender;
18 18
 - (NSMutableArray *)messages;
80  Examples/OSX/InboxLister/MyController.m
@@ -3,65 +3,65 @@
3 3
 @implementation MyController
4 4
 - (id)init
5 5
 {
6  
-	self = [super init];
7  
-	if(self)
8  
-	{
9  
-		myAccount = [[CTCoreAccount alloc] init];
10  
-		myMessages = [[NSMutableArray alloc] init];
11  
-	}
12  
-	return self;
  6
+    self = [super init];
  7
+    if(self)
  8
+    {
  9
+        myAccount = [[CTCoreAccount alloc] init];
  10
+        myMessages = [[NSMutableArray alloc] init];
  11
+    }
  12
+    return self;
13 13
 }
14 14
 
15 15
 
16 16
 - (void)dealloc
17 17
 {
18  
-	[myAccount release];
19  
-	[myMessages release];
20  
-	[super dealloc];
  18
+    [myAccount release];
  19
+    [myMessages release];
  20
+    [super dealloc];
21 21
 }
22 22
 
23 23
 
24 24
 - (IBAction)connect:(id)sender
25 25
 {
26  
-	NSLog(@"Connecting...");
27  
-	
28  
-	if ([useTLS state] == NSOnState )
29  
-	{
30  
-		[myAccount connectToServer:[server stringValue] port:[port intValue] connectionType:CONNECTION_TYPE_TLS
31  
-				authType:IMAP_AUTH_TYPE_PLAIN login:[username stringValue] password:[password stringValue]];
32  
-	}
33  
-	else
34  
-	{
35  
-		[myAccount connectToServer:[server stringValue] port:[port intValue] connectionType:CONNECTION_TYPE_PLAIN 
36  
-				authType:IMAP_AUTH_TYPE_PLAIN login:[username stringValue] password:[password stringValue]];
37  
-	}
38  
-	CTCoreFolder *inbox = [myAccount folderWithPath:@"INBOX"];
39  
-	NSLog(@"INBOX %@", inbox);
40  
-	// set the toIndex to 0 so all messages are loaded
41  
-	NSSet *messageSet = [inbox messageObjectsFromIndex:1 toIndex:0]; 
42  
-	NSLog(@"Done getting list of messages...");
43  
-	
44  
-	NSMutableSet *messagesProxy = [self mutableSetValueForKey:@"messages"];
45  
-	NSEnumerator *objEnum = [messageSet objectEnumerator];
46  
-	id msg;
47  
-	
48  
-	while(msg = [objEnum nextObject]) {
49  
-		[msg fetchBodyStructure];
50  
-		[messagesProxy addObject:msg];
51  
-	}
  26
+    NSLog(@"Connecting...");
  27
+
  28
+    if ([useTLS state] == NSOnState )
  29
+    {
  30
+        [myAccount connectToServer:[server stringValue] port:[port intValue] connectionType:CONNECTION_TYPE_TLS
  31
+                authType:IMAP_AUTH_TYPE_PLAIN login:[username stringValue] password:[password stringValue]];
  32
+    }
  33
+    else
  34
+    {
  35
+        [myAccount connectToServer:[server stringValue] port:[port intValue] connectionType:CONNECTION_TYPE_PLAIN
  36
+                authType:IMAP_AUTH_TYPE_PLAIN login:[username stringValue] password:[password stringValue]];
  37
+    }
  38
+    CTCoreFolder *inbox = [myAccount folderWithPath:@"INBOX"];
  39
+    NSLog(@"INBOX %@", inbox);
  40
+    // set the toIndex to 0 so all messages are loaded
  41
+    NSSet *messageSet = [inbox messageObjectsFromIndex:1 toIndex:0];
  42
+    NSLog(@"Done getting list of messages...");
  43
+
  44
+    NSMutableSet *messagesProxy = [self mutableSetValueForKey:@"messages"];
  45
+    NSEnumerator *objEnum = [messageSet objectEnumerator];
  46
+    id msg;
  47
+
  48
+    while(msg = [objEnum nextObject]) {
  49
+        [msg fetchBodyStructure];
  50
+        [messagesProxy addObject:msg];
  51
+    }
52 52
 }
53 53
 
54 54
 
55 55
 - (NSMutableArray *)messages
56 56
 {
57  
-	return myMessages;
  57
+    return myMessages;
58 58
 }
59 59
 
60 60
 
61 61
 - (void)setMessages:(NSMutableArray *)messages
62 62
 {
63  
-	[messages retain];
64  
-	[myMessages release];
65  
-	myMessages = messages;
  63
+    [messages retain];
  64
+    [myMessages release];
  65
+    myMessages = messages;
66 66
 }
67 67
 @end
10  Examples/OSX/MessageSender/MessageSender.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
3 3
 	archiveVersion = 1;
4 4
 	classes = {
5 5
 	};
6  
-	objectVersion = 42;
  6
+	objectVersion = 46;
7 7
 	objects = {
8 8
 
9 9
 /* Begin PBXBuildFile section */
@@ -197,8 +197,11 @@
197 197
 /* Begin PBXProject section */
198 198
 		29B97313FDCFA39411CA2CEA /* Project object */ = {
199 199
 			isa = PBXProject;
  200
+			attributes = {
  201
+				LastUpgradeCheck = 0430;
  202
+			};
200 203
 			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MessageSender" */;
201  
-			compatibilityVersion = "Xcode 2.4";
  204
+			compatibilityVersion = "Xcode 3.2";
202 205
 			developmentRegion = English;
203 206
 			hasScannedForEncodings = 1;
204 207
 			knownRegions = (
@@ -292,7 +295,6 @@
292 295
 			buildSettings = {
293 296
 				COPY_PHASE_STRIP = NO;
294 297
 				GCC_DYNAMIC_NO_PIC = NO;
295  
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
296 298
 				GCC_MODEL_TUNING = G5;
297 299
 				GCC_OPTIMIZATION_LEVEL = 0;
298 300
 				HEADER_SEARCH_PATHS = (
@@ -328,7 +330,6 @@
328 330
 			buildSettings = {
329 331
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
330 332
 				GCC_WARN_UNUSED_VARIABLE = YES;
331  
-				PREBINDING = NO;
332 333
 				SDKROOT = macosx;
333 334
 			};
334 335
 			name = Debug;
@@ -338,7 +339,6 @@
338 339
 			buildSettings = {
339 340
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
340 341
 				GCC_WARN_UNUSED_VARIABLE = YES;
341  
-				PREBINDING = NO;
342 342
 				SDKROOT = macosx;
343 343
 			};
344 344
 			name = Release;
6  Examples/OSX/MessageSender/MyController.h
@@ -9,10 +9,10 @@
9 9
     IBOutlet id port;
10 10
     IBOutlet id server;
11 11
     IBOutlet id username;
12  
-	IBOutlet id useAuth;
13  
-	IBOutlet id useTLS;
  12
+    IBOutlet id useAuth;
  13
+    IBOutlet id useTLS;
14 14
 
15  
-	CTCoreMessage *myMessage;
  15
+    CTCoreMessage *myMessage;
16 16
 }
17 17
 - (IBAction)sendMessage:(id)sender;
18 18
 - (NSString *)to;
62  Examples/OSX/MessageSender/MyController.m
@@ -3,77 +3,77 @@
3 3
 @implementation MyController
4 4
 - (id)init
5 5
 {
6  
-	self = [super init];
7  
-	if(self)
8  
-	{
9  
-		myMessage = [[CTCoreMessage alloc] init];
10  
-	}
11  
-	return self;
  6
+    self = [super init];
  7
+    if(self)
  8
+    {
  9
+        myMessage = [[CTCoreMessage alloc] init];
  10
+    }
  11
+    return self;
12 12
 }
13 13
 
14 14
 - (void)dealloc
15 15
 {
16  
-	[myMessage release];
17  
-	[super dealloc];
  16
+    [myMessage release];
  17
+    [super dealloc];
18 18
 }
19 19
 
20 20
 - (IBAction)sendMessage:(id)sender
21 21
 {
22  
-	CTCoreMessage *msg = [[CTCoreMessage alloc] init];
23  
-	[msg setTo:[myMessage to]];
24  
-	[msg setFrom:[myMessage from]];
25  
-	[msg setBody:[myMessage body]];
26  
-	[msg setSubject:[myMessage subject]];
  22
+    CTCoreMessage *msg = [[CTCoreMessage alloc] init];
  23
+    [msg setTo:[myMessage to]];
  24
+    [msg setFrom:[myMessage from]];
  25
+    [msg setBody:[myMessage body]];
  26
+    [msg setSubject:[myMessage subject]];
27 27
 
28  
-	BOOL auth = ([useAuth state] == NSOnState);
29  
-	BOOL tls = ([useTLS state] == NSOnState);
30  
-	[CTSMTPConnection sendMessage:msg server:[server stringValue] username:[username stringValue]
31  
-		password:[password stringValue] port:[port intValue] useTLS:tls useAuth:auth];
32  
-	[msg release];
  28
+    BOOL auth = ([useAuth state] == NSOnState);
  29
+    BOOL tls = ([useTLS state] == NSOnState);
  30
+    [CTSMTPConnection sendMessage:msg server:[server stringValue] username:[username stringValue]
  31
+        password:[password stringValue] port:[port intValue] useTLS:tls useAuth:auth];
  32
+    [msg release];
33 33
 }
34 34
 
35 35
 - (NSString *)to
36 36
 {
37  
-	return [[[myMessage to] anyObject] email];
  37
+    return [[[myMessage to] anyObject] email];
38 38
 }
39 39
 
40 40
 - (void)setTo:(NSString *)aValue
41 41
 {
42  
-	CTCoreAddress *addr = [CTCoreAddress address];
43  
-	[addr setEmail:aValue];
44  
-	[myMessage setTo:[NSSet setWithObject:addr]];
  42
+    CTCoreAddress *addr = [CTCoreAddress address];
  43
+    [addr setEmail:aValue];
  44
+    [myMessage setTo:[NSSet setWithObject:addr]];
45 45
 }
46 46
 
47 47
 - (NSString *)from
48 48
 {
49  
-	return [[[myMessage from] anyObject] email];
  49
+    return [[[myMessage from] anyObject] email];
50 50
 }
51 51
 
52 52
 - (void)setFrom:(NSString *)aValue
53 53
 {
54  
-	CTCoreAddress *addr = [CTCoreAddress address];
55  
-	[addr setEmail:aValue];
56  
-	[addr setName:@""];
57  
-	[myMessage setFrom:[NSSet setWithObject:addr]];
  54
+    CTCoreAddress *addr = [CTCoreAddress address];
  55
+    [addr setEmail:aValue];
  56
+    [addr setName:@""];
  57
+    [myMessage setFrom:[NSSet setWithObject:addr]];
58 58
 }
59 59
 
60 60
 - (NSString *)subject
61 61
 {
62  
-	return [myMessage subject];
  62
+    return [myMessage subject];
63 63
 }
64 64
 
65 65
 - (void)setSubject:(NSString *)aValue
66 66
 {
67  
-	[myMessage setSubject:aValue];
  67
+    [myMessage setSubject:aValue];
68 68
 }
69 69
 
70 70
 - (NSString *)body
71 71
 {
72  
-	return [myMessage body];
  72
+    return [myMessage body];
73 73
 }
74 74
 
75 75
 - (void)setBody:(NSString *)aValue
76 76
 {
77  
-	[myMessage setBody:aValue];
  77
+    [myMessage setBody:aValue];
78 78
 }
79 79
 @end
10  Examples/iOS/MessageSender/MessageSender/ViewController.m
@@ -21,13 +21,13 @@ - (void)didReceiveMemoryWarning
21 21
 - (void)viewDidLoad
22 22
 {
23 23
     [super viewDidLoad];
24  
-	// Do any additional setup after loading the view, typically from a nib.
25  
-    
  24
+    // Do any additional setup after loading the view, typically from a nib.
  25
+
26 26
     CTCoreMessage *msg = [[CTCoreMessage alloc] init];
27 27
 
28 28
 //	[CTSMTPConnection sendMessage:msg server:[server stringValue] username:[username stringValue]
29 29
 //                         password:[password stringValue] port:[port intValue] useTLS:tls useAuth:auth];
30  
-	[msg release];
  30
+    [msg release];
31 31
 }
32 32
 
33 33
 - (void)viewDidUnload
@@ -49,12 +49,12 @@ - (void)viewDidAppear:(BOOL)animated
49 49
 
50 50
 - (void)viewWillDisappear:(BOOL)animated
51 51
 {
52  
-	[super viewWillDisappear:animated];
  52
+    [super viewWillDisappear:animated];
53 53
 }
54 54
 
55 55
 - (void)viewDidDisappear:(BOOL)animated
56 56
 {
57  
-	[super viewDidDisappear:animated];
  57
+    [super viewDidDisappear:animated];
58 58
 }
59 59
 
60 60
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
6  Source/CTBareAttachment.h
@@ -36,9 +36,9 @@
36 36
 
37 37
 //TODO Document me
38 38
 @interface CTBareAttachment : NSObject {
39  
-	CTMIME_SinglePart *mMIMEPart;
40  
-	NSString *mFilename;
41  
-	NSString *mContentType;
  39
+    CTMIME_SinglePart *mMIMEPart;
  40
+    NSString *mFilename;
  41
+    NSString *mContentType;
42 42
 }
43 43
 @property(retain) NSString *filename;
44 44
 @property(retain) NSString *contentType;
32  Source/CTBareAttachment.m
@@ -42,22 +42,22 @@ @implementation CTBareAttachment
42 42
 @synthesize filename=mFilename;
43 43
 
44 44
 - (id)initWithMIMESinglePart:(CTMIME_SinglePart *)part {
45  
-	self = [super init];
46  
-	if (self) {
47  
-		mMIMEPart = [part retain];
48  
-		self.filename = mMIMEPart.filename;
49  
-		self.contentType = mMIMEPart.contentType;
50  
-	}
51  
-	return self;
  45
+    self = [super init];
  46
+    if (self) {
  47
+        mMIMEPart = [part retain];
  48
+        self.filename = mMIMEPart.filename;
  49
+        self.contentType = mMIMEPart.contentType;
  50
+    }
  51
+    return self;
52 52
 }
53 53
 
54 54
 -(NSString*)decodedFilename {
55  
-	return MailCoreDecodeMIMEPhrase((char *)[self.filename UTF8String]);
  55
+    return MailCoreDecodeMIMEPhrase((char *)[self.filename UTF8String]);
56 56
 }
57 57
 
58 58
 - (NSString *)description {
59  
-	return [NSString stringWithFormat:@"ContentType: %@\tFilename: %@",
60  
-				self.contentType, self.filename];
  59
+    return [NSString stringWithFormat:@"ContentType: %@\tFilename: %@",
  60
+                self.contentType, self.filename];
61 61
 }
62 62
 
63 63
 - (CTCoreAttachment *)fetchFullAttachment {
@@ -66,9 +66,9 @@ - (CTCoreAttachment *)fetchFullAttachment {
66 66
 
67 67
 - (CTCoreAttachment *)fetchFullAttachmentWithProgress:(CTProgressBlock)block {
68 68
     [mMIMEPart fetchPartWithProgress:block];
69  
-	CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithData:mMIMEPart.data
  69
+    CTCoreAttachment *attach = [[CTCoreAttachment alloc] initWithData:mMIMEPart.data
70 70
                                                           contentType:self.contentType filename:self.filename];
71  
-	return [attach autorelease];
  71
+    return [attach autorelease];
72 72
 }
73 73
 
74 74
 - (CTMIME_SinglePart *)part {
@@ -76,9 +76,9 @@ - (CTMIME_SinglePart *)part {
76 76
 }
77 77
 
78 78
 - (void)dealloc {
79  
-	[mMIMEPart release];
80  
-	[mFilename release];
81  
-	[mContentType release];
82  
-	[super dealloc];
  79
+    [mMIMEPart release];
  80
+    [mFilename release];
  81
+    [mContentType release];
  82
+    [super dealloc];
83 83
 }
84 84
 @end
4  Source/CTBareMessage.h
@@ -35,8 +35,8 @@
35 35
 //TODO Document me
36 36
 //TODO Eventually CTCoreMessage should inherit from this
37 37
 @interface CTBareMessage : NSObject {
38  
-	NSString *mUid;
39  
-	unsigned int mFlags;
  38
+    NSString *mUid;
  39
+    unsigned int mFlags;
40 40
 }
41 41
 @property(retain) NSString *uid;
42 42
 @property unsigned int flags;
20  Source/CTBareMessage.m
@@ -35,24 +35,24 @@ @implementation CTBareMessage
35 35
 @synthesize uid=mUid, flags=mFlags;
36 36
 
37 37
 - (id)init {
38  
-	self = [super init];
39  
-	if (self != nil) {
40  
-		self.uid = @"";
41  
-		self.flags = 0;
42  
-	}
43  
-	return self;
  38
+    self = [super init];
  39
+    if (self != nil) {
  40
+        self.uid = @"";
  41
+        self.flags = 0;
  42
+    }
  43
+    return self;
44 44
 }
45 45
 
46 46
 - (NSString *)description {
47  
-	return [NSString stringWithFormat:@"UID: %@\n Flags: %d\n", self.uid, self.flags];
  47
+    return [NSString stringWithFormat:@"UID: %@\n Flags: %d\n", self.uid, self.flags];
48 48
 }
49 49
 
50 50
 - (NSUInteger)hash {
51  
-	NSString *str = [NSString stringWithFormat:@"%@%d", self.uid, self.flags];
52  
-	return [str hash];
  51
+    NSString *str = [NSString stringWithFormat:@"%@%d", self.uid, self.flags];
  52
+    return [str hash];
53 53
 }
54 54
 
55 55
 - (BOOL)isEqual:(id)anObject {
56  
-	return ([self hash] == [anObject hash]);
  56
+    return ([self hash] == [anObject hash]);
57 57
 }
58 58
 @end
56  Source/CTCoreAccount.h
@@ -33,62 +33,62 @@
33 33
 #import <libetpan/libetpan.h>
34 34
 
35 35
 /*!
36  
-	@class CTCoreAccount
37  
-	CTCoreAccount is the base class with which you establish a connection to the 
38  
-	IMAP server. After establishing a connection with CTCoreAccount you can access 
39  
-	all of the folders (I use the term folder instead of mailbox) on the server.
40  
-	All methods throw an exception on failure.
  36
+    @class CTCoreAccount
  37
+    CTCoreAccount is the base class with which you establish a connection to the
  38
+    IMAP server. After establishing a connection with CTCoreAccount you can access
  39
+    all of the folders (I use the term folder instead of mailbox) on the server.
  40
+    All methods throw an exception on failure.
41 41
 */
42 42
 
43 43
 @class CTCoreFolder;
44 44
 
45 45
 @interface CTCoreAccount : NSObject {	
46  
-	struct mailstorage	*myStorage;
47  
-	BOOL				connected;
  46
+    struct mailstorage	*myStorage;
  47
+    BOOL				connected;
48 48
 }
49 49
 
50 50
 /*!
51  
-	@abstract	Retrieves the list of all the available folders from the server.
52  
-	@result		Returns a NSSet which contains NSStrings of the folders pathnames.
  51
+    @abstract	Retrieves the list of all the available folders from the server.
  52
+    @result		Returns a NSSet which contains NSStrings of the folders pathnames.
53 53
 */
54 54
 - (NSSet *)allFolders;
55 55
 
56 56
 /*!
57  
-	@abstract	Retrieves a list of only the subscribed folders from the server.
58  
-	@result		Returns a NSSet which contains NSStrings of the folders pathnames.
  57
+    @abstract	Retrieves a list of only the subscribed folders from the server.
  58
+    @result		Returns a NSSet which contains NSStrings of the folders pathnames.
59 59
 */
60 60
 - (NSSet *)subscribedFolders;
61 61
 
62 62
 /*!
63  
-	@abstract	If you have the path of a folder on the server use this method to retrieve just the one folder.
64  
-	@param		path A NSString specifying the path of the folder to retrieve from the server.
65  
-	@result		Returns a CTCoreFolder.
  63
+    @abstract	If you have the path of a folder on the server use this method to retrieve just the one folder.
  64
+    @param		path A NSString specifying the path of the folder to retrieve from the server.
  65
+    @result		Returns a CTCoreFolder.
66 66
 */
67 67
 - (CTCoreFolder *)folderWithPath:(NSString *)path;
68 68
 
69 69
 
70 70
 /*!
71  
-	@abstract	This method initiates the connection to the server.
72  
-	@param		server The address of the server.
73  
-	@param		port The port to connect to.
74  
-	@param		connnectionType What kind of connection to use, it can be one of these three values:
75  
-				CONNECTION_TYPE_PLAIN, CONNECTION_TYPE_STARTTLS, CONNECTION_TYPE_TRY_STARTTLS, CONNECTION_TYPE_TLS
76  
-	@param		authType The authentication type, only IMAP_AUTH_TYPE_PLAIN is currently supported
77  
-	@param		login The username to connect with.
78  
-	@param		password The password to use to connect.
  71
+    @abstract	This method initiates the connection to the server.
  72
+    @param		server The address of the server.
  73
+    @param		port The port to connect to.
  74
+    @param		connnectionType What kind of connection to use, it can be one of these three values:
  75
+                CONNECTION_TYPE_PLAIN, CONNECTION_TYPE_STARTTLS, CONNECTION_TYPE_TRY_STARTTLS, CONNECTION_TYPE_TLS
  76
+    @param		authType The authentication type, only IMAP_AUTH_TYPE_PLAIN is currently supported
  77
+    @param		login The username to connect with.
  78
+    @param		password The password to use to connect.
79 79
 */
80 80
 - (void)connectToServer:(NSString *)server port:(int)port connectionType:(int)conType authType:(int)authType 
81  
-						login:(NSString *)login password:(NSString *)password;
82  
-						
  81
+                        login:(NSString *)login password:(NSString *)password;
  82
+
83 83
 /*!
84  
-	@abstract	This method returns the current connection status.
85  
-	@result		Returns YES or NO as the status of the connection.
  84
+    @abstract	This method returns the current connection status.
  85
+    @result		Returns YES or NO as the status of the connection.
86 86
 */
87 87
 - (BOOL)isConnected;
88 88
 
89 89
 /*!
90  
-	@abstract	Terminates the connection. If you terminate this connection it will also affect the
91  
-				connectivity of CTCoreFolders and CTMessages that rely on this account.
  90
+    @abstract	Terminates the connection. If you terminate this connection it will also affect the
  91
+                connectivity of CTCoreFolders and CTMessages that rely on this account.
92 92
 */
93 93
 - (void)disconnect;
94 94
 
315  Source/CTCoreAccount.m
@@ -39,222 +39,223 @@ @interface CTCoreAccount (Private)
39 39
 
40 40
 @implementation CTCoreAccount
41 41
 - (id)init {
42  
-	self = [super init];
43  
-	if (self) {
44  
-		connected = NO;
45  
-		myStorage = mailstorage_new(NULL);
46  
-		assert(myStorage != NULL);	
47  
-	}
48  
-	return self;
  42
+    self = [super init];
  43
+    if (self) {
  44
+        connected = NO;
  45
+        myStorage = mailstorage_new(NULL);
  46
+        assert(myStorage != NULL);
  47
+    }
  48
+    return self;
49 49
 }
50 50
 
51 51
 
52 52
 - (void)dealloc {
53  
-	mailstorage_disconnect(myStorage);
54  
-	mailstorage_free(myStorage);
55  
-	[super dealloc]; 
  53
+    mailstorage_disconnect(myStorage);
  54
+    mailstorage_free(myStorage);
  55
+    [super dealloc];
56 56
 }
57 57
 
58 58
 
59 59
 - (BOOL)isConnected {
60  
-	return connected;
  60
+    return connected;
61 61
 }
62 62
 
63 63
 
64 64
 //TODO, should I use the cache?
65 65
 - (void)connectToServer:(NSString *)server port:(int)port 
66  
-		connectionType:(int)conType authType:(int)authType
67  
-		login:(NSString *)login password:(NSString *)password {
68  
-	int err = 0;
69  
-	int imap_cached = 0;
70  
-
71  
-	const char* auth_type_to_pass = NULL;
72  
-	if(authType == IMAP_AUTH_TYPE_SASL_CRAM_MD5) {
73  
-		auth_type_to_pass = "CRAM-MD5";
74  
-	}
75  
-	
76  
-	err = imap_mailstorage_init_sasl(myStorage,
77  
-									 (char *)[server cStringUsingEncoding:NSUTF8StringEncoding],
78  
-									 (uint16_t)port, NULL,
79  
-									 conType,
80  
-									 auth_type_to_pass,
81  
-									 NULL,
82  
-									 NULL, NULL,
83  
-									 (char *)[login cStringUsingEncoding:NSUTF8StringEncoding], (char *)[login cStringUsingEncoding:NSUTF8StringEncoding],
84  
-									 (char *)[password cStringUsingEncoding:NSUTF8StringEncoding], NULL,
85  
-									 imap_cached, NULL);
86  
-		
87  
-	if (err != MAIL_NO_ERROR) {
88  
-		NSException *exception = [NSException
89  
-		        exceptionWithName:CTMemoryError
90  
-		        reason:CTMemoryErrorDesc
91  
-		        userInfo:nil];
92  
-		[exception raise];
93  
-	}
94  
-						
95  
-	err = mailstorage_connect(myStorage);
96  
-	if (err == MAIL_ERROR_LOGIN) {
97  
-		NSException *exception = [NSException
98  
-		        exceptionWithName:CTLoginError
99  
-		        reason:CTLoginErrorDesc
100  
-		        userInfo:nil];
101  
-		[exception raise];
102  
-	}
103  
-	else if (err != MAIL_NO_ERROR) {
104  
-		NSException *exception = [NSException
105  
-		        exceptionWithName:CTUnknownError
106  
-		        reason:[NSString stringWithFormat:@"Error number: %d",err]
107  
-		        userInfo:nil];
108  
-		[exception raise];
109  
-	}
110  
-	else	
111  
-		connected = YES;
  66
+        connectionType:(int)conType authType:(int)authType
  67
+        login:(NSString *)login password:(NSString *)password {
  68
+    int err = 0;
  69
+    int imap_cached = 0;
  70
+
  71
+    const char* auth_type_to_pass = NULL;
  72
+    if(authType == IMAP_AUTH_TYPE_SASL_CRAM_MD5) {
  73
+        auth_type_to_pass = "CRAM-MD5";
  74
+    }
  75
+
  76
+    err = imap_mailstorage_init_sasl(myStorage,
  77
+                                     (char *)[server cStringUsingEncoding:NSUTF8StringEncoding],
  78
+                                     (uint16_t)port, NULL,
  79
+                                     conType,
  80
+                                     auth_type_to_pass,
  81
+                                     NULL,
  82
+                                     NULL, NULL,
  83
+                                     (char *)[login cStringUsingEncoding:NSUTF8StringEncoding], (char *)[login cStringUsingEncoding:NSUTF8StringEncoding],
  84
+                                     (char *)[password cStringUsingEncoding:NSUTF8StringEncoding], NULL,
  85
+                                     imap_cached, NULL);
  86
+
  87
+    if (err != MAIL_NO_ERROR) {
  88
+        NSException *exception = [NSException
  89
+                exceptionWithName:CTMemoryError
  90
+                reason:CTMemoryErrorDesc
  91
+                userInfo:nil];
  92
+        [exception raise];
  93
+    }
  94
+
  95
+    err = mailstorage_connect(myStorage);
  96
+    if (err == MAIL_ERROR_LOGIN) {
  97
+        NSException *exception = [NSException
  98
+                exceptionWithName:CTLoginError
  99
+                reason:CTLoginErrorDesc
  100
+                userInfo:nil];
  101
+        [exception raise];
  102
+    }
  103
+    else if (err != MAIL_NO_ERROR) {
  104
+        NSException *exception = [NSException
  105
+                exceptionWithName:CTUnknownError
  106
+                reason:[NSString stringWithFormat:@"Error number: %d",err]
  107
+                userInfo:nil];
  108
+        [exception raise];
  109
+    }
  110
+    else {
  111
+        connected = YES;
  112
+    }
112 113
 }
113 114
 
114 115
 - (void)idle {
115 116
     int err = mailimap_idle([self session]);
116  
-    
  117
+
117 118
     if (err != 0) {
118  
-		NSException *exception = [NSException
  119
+        NSException *exception = [NSException
119 120
                                   exceptionWithName:CTUnknownError
120 121
                                   reason:[NSString stringWithFormat:@"Error number: %d", err]
121 122
                                   userInfo:nil];
122  
-		[exception raise];
  123
+        [exception raise];
123 124
     }
124 125
 }
125 126
 
126 127
 - (NSString*)read {
127 128
     char * buf = mailimap_read_line([self session]);
128  
-    
  129
+
129 130
     if (buf == NULL) {
130 131
         return nil;
131 132
     }
132  
-    
  133
+
133 134
     return [NSString stringWithCString:buf encoding:NSUTF8StringEncoding];
134 135
 }
135 136
 
136 137
 - (void)done {
137 138
     int err = mailimap_idle_done([self session]);
138  
-    
  139
+
139 140
     if (err != 0) {
140  
-		NSException *exception = [NSException
  141
+        NSException *exception = [NSException
141 142
                                   exceptionWithName:CTUnknownError
142 143
                                   reason:[NSString stringWithFormat:@"Error number: %d", err]
143 144
                                   userInfo:nil];
144  
-		[exception raise];
  145
+        [exception raise];
145 146
     }
146 147
 }
147 148
 
148 149
 - (void)disconnect {
149  
-	connected = NO;
150  
-	mailstorage_disconnect(myStorage);
  150
+    connected = NO;
  151
+    mailstorage_disconnect(myStorage);
151 152
 }
152 153
 
153 154
 - (CTCoreFolder *)folderWithPath:(NSString *)path {
154  
-	CTCoreFolder *folder = [[CTCoreFolder alloc] initWithPath:path inAccount:self];
155  
-	return [folder autorelease];
  155
+    CTCoreFolder *folder = [[CTCoreFolder alloc] initWithPath:path inAccount:self];
  156
+    return [folder autorelease];
156 157
 }
157 158
 
158 159
 
159 160
 - (mailimap *)session {
160  
-	struct imap_cached_session_state_data * cached_data;
161  
-	struct imap_session_state_data * data;
162  
-	mailsession *session;
163  
-   
164  
-	session = myStorage->sto_session;
165  
-	if(session == nil) {
166  
-		return nil;
167  
-	}
168  
-	if (strcasecmp(session->sess_driver->sess_name, "imap-cached") == 0) {
169  
-    	cached_data = session->sess_data;
170  
-    	session = cached_data->imap_ancestor;
171  
-  	}
172  
-
173  
-	data = session->sess_data;
174  
-	return data->imap_session;
  161
+    struct imap_cached_session_state_data * cached_data;
  162
+    struct imap_session_state_data * data;
  163
+    mailsession *session;
  164
+
  165
+    session = myStorage->sto_session;
  166
+    if(session == nil) {
  167
+        return nil;
  168
+    }
  169
+    if (strcasecmp(session->sess_driver->sess_name, "imap-cached") == 0) {
  170
+        cached_data = session->sess_data;
  171
+        session = cached_data->imap_ancestor;
  172
+    }
  173
+
  174
+    data = session->sess_data;
  175
+    return data->imap_session;
175 176
 }
176 177
 
177 178
 
178 179
 - (struct mailstorage *)storageStruct {
179  
-	return myStorage;
  180
+    return myStorage;
180 181
 }
181 182
 
182 183
 
183 184
 - (NSSet *)subscribedFolders {
184  
-	struct mailimap_mailbox_list * mailboxStruct;
185  
-	clist *subscribedList;
186  
-	clistiter *cur;
187  
-	
188  
-	NSString *mailboxNameObject;
189  
-	char *mailboxName;
190  
-	int err;
191  
-	
192  
-	NSMutableSet *subscribedFolders = [NSMutableSet set];	
193  
-	
194  
-	//Fill the subscribed folder array
195  
-	err = mailimap_lsub([self session], "", "*", &subscribedList);
196  
-	if (err != MAIL_NO_ERROR) {
197  
-		NSException *exception = [NSException
198  
-			        exceptionWithName:CTUnknownError
199  
-			        reason:[NSString stringWithFormat:@"Error number: %d",err]
200  
-			        userInfo:nil];
201  
-		[exception raise];
202  
-	}
203  
-	else if (clist_isempty(subscribedList)) {
204  
-		NSException *exception = [NSException
205  
-			        exceptionWithName:CTNoSubscribedFolders
206  
-			        reason:CTNoSubscribedFoldersDesc
207  
-			        userInfo:nil];
208  
-		[exception raise];
209  
-	}
210  
-	for(cur = clist_begin(subscribedList); cur != NULL; cur = cur->next) {
211  
-		mailboxStruct = cur->data;
212  
-		mailboxName = mailboxStruct->mb_name;
213  
-		mailboxNameObject = [NSString stringWithCString:mailboxName encoding:NSUTF8StringEncoding];
214  
-		[subscribedFolders addObject:mailboxNameObject];
215  
-	}
216  
-	mailimap_list_result_free(subscribedList);
217  
-	return subscribedFolders;
  185
+    struct mailimap_mailbox_list * mailboxStruct;
  186
+    clist *subscribedList;
  187
+    clistiter *cur;
  188
+
  189
+    NSString *mailboxNameObject;
  190
+    char *mailboxName;
  191
+    int err;
  192
+
  193
+    NSMutableSet *subscribedFolders = [NSMutableSet set];
  194
+
  195
+    //Fill the subscribed folder array
  196
+    err = mailimap_lsub([self session], "", "*", &subscribedList);
  197
+    if (err != MAIL_NO_ERROR) {
  198
+        NSException *exception = [NSException
  199
+                    exceptionWithName:CTUnknownError
  200
+                    reason:[NSString stringWithFormat:@"Error number: %d",err]
  201
+                    userInfo:nil];
  202
+        [exception raise];
  203
+    }
  204
+    else if (clist_isempty(subscribedList)) {
  205
+        NSException *exception = [NSException
  206
+                    exceptionWithName:CTNoSubscribedFolders
  207
+                    reason:CTNoSubscribedFoldersDesc
  208
+                    userInfo:nil];
  209
+        [exception raise];
  210
+    }
  211
+    for(cur = clist_begin(subscribedList); cur != NULL; cur = cur->next) {
  212
+        mailboxStruct = cur->data;
  213
+        mailboxName = mailboxStruct->mb_name;
  214
+        mailboxNameObject = [NSString stringWithCString:mailboxName encoding:NSUTF8StringEncoding];
  215
+        [subscribedFolders addObject:mailboxNameObject];
  216
+    }
  217
+    mailimap_list_result_free(subscribedList);
  218
+    return subscribedFolders;
218 219
 }
219 220
 
220 221
 - (NSSet *)allFolders {
221  
-	struct mailimap_mailbox_list * mailboxStruct;
222  
-	clist *allList;
223  
-	clistiter *cur;
224  
-	
225  
-	NSString *mailboxNameObject;
226  
-	char *mailboxName;
227  
-	int err;
228  
-	
229  
-	NSMutableSet *allFolders = [NSMutableSet set];
230  
-
231  
-	//Now, fill the all folders array
232  
-	//TODO Fix this so it doesn't use *
233  
-	err = mailimap_list([self session], "", "*", &allList);		
234  
-	if (err != MAIL_NO_ERROR)
235  
-	{
236  
-		NSException *exception = [NSException
237  
-			        exceptionWithName:CTUnknownError
238  
-			        reason:[NSString stringWithFormat:@"Error number: %d",err]
239  
-			        userInfo:nil];
240  
-		[exception raise];
241  
-	}
242  
-	else if (clist_isempty(allList))
243  
-	{
244  
-		NSException *exception = [NSException
245  
-			        exceptionWithName:CTNoFolders
246  
-			        reason:CTNoFoldersDesc
247  
-			        userInfo:nil];
248  
-		[exception raise];
249  
-	}
250  
-	for(cur = clist_begin(allList); cur != NULL; cur = cur->next)
251  
-	{
252  
-		mailboxStruct = cur->data;
253  
-		mailboxName = mailboxStruct->mb_name;
254  
-		mailboxNameObject = [NSString stringWithCString:mailboxName encoding:NSUTF8StringEncoding];
255  
-		[allFolders addObject:mailboxNameObject];
256  
-	}
257  
-	mailimap_list_result_free(allList);
258  
-	return allFolders;
  222
+    struct mailimap_mailbox_list * mailboxStruct;
  223
+    clist *allList;
  224
+    clistiter *cur;
  225
+
  226
+    NSString *mailboxNameObject;
  227
+    char *mailboxName;
  228
+    int err;
  229
+
  230
+    NSMutableSet *allFolders = [NSMutableSet set];
  231
+
  232
+    //Now, fill the all folders array
  233
+    //TODO Fix this so it doesn't use *
  234
+    err = mailimap_list([self session], "", "*", &allList);
  235
+    if (err != MAIL_NO_ERROR)
  236
+    {
  237
+        NSException *exception = [NSException
  238
+                    exceptionWithName:CTUnknownError
  239
+                    reason:[NSString stringWithFormat:@"Error number: %d",err]
  240
+                    userInfo:nil];
  241
+        [exception raise];
  242
+    }
  243
+    else if (clist_isempty(allList))
  244
+    {
  245
+        NSException *exception = [NSException
  246
+                    exceptionWithName:CTNoFolders
  247
+                    reason:CTNoFoldersDesc
  248
+                    userInfo:nil];
  249
+        [exception raise];
  250
+    }
  251
+    for(cur = clist_begin(allList); cur != NULL; cur = cur->next)
  252
+    {
  253
+        mailboxStruct = cur->data;
  254
+        mailboxName = mailboxStruct->mb_name;
  255
+        mailboxNameObject = [NSString stringWithCString:mailboxName encoding:NSUTF8StringEncoding];
  256
+        [allFolders addObject:mailboxNameObject];
  257
+    }
  258
+    mailimap_list_result_free(allList);
  259
+    return allFolders;
259 260
 }
260 261
 @end
30  Source/CTCoreAddress.h
@@ -32,59 +32,59 @@
32 32
 #import <Foundation/Foundation.h>
33 33
 
34 34
 /*!
35  
-	@class	@CTCoreAddress
36  
-	This is a very simple class designed to make it easier to work with email addresses since many times
37  
-	the e-mail address and name are both encoded in the MIME e-mail fields. This class should be very straight
38  
-	forward, you can get and set a name and an e-mail address.
  35
+    @class	@CTCoreAddress
  36
+    This is a very simple class designed to make it easier to work with email addresses since many times
  37
+    the e-mail address and name are both encoded in the MIME e-mail fields. This class should be very straight
  38
+    forward, you can get and set a name and an e-mail address.
39 39
 */
40 40
 
41 41
 @interface CTCoreAddress : NSObject {
42  
-	NSString *email;
43  
-	NSString *name;
  42
+    NSString *email;
  43
+    NSString *name;
44 44
 }
45 45
 /*!
46  
-	@abstract Returns a CTCoreAddress with the name and e-mail address set as an empty string.
  46
+    @abstract Returns a CTCoreAddress with the name and e-mail address set as an empty string.
47 47
 */
48 48
 + (id)address;
49 49
 
50 50
 /*!
51  
-	@abstract Returns a CTCoreAddress set with the specified name and email.
  51
+    @abstract Returns a CTCoreAddress set with the specified name and email.
52 52
 */
53 53
 + (id)addressWithName:(NSString *)aName email:(NSString *)aEmail;
54 54
 
55 55
 /*!
56  
-	@abstract Returns a CTCoreAddress set with the specified name and email.
  56
+    @abstract Returns a CTCoreAddress set with the specified name and email.
57 57
 */
58 58
 - (id)initWithName:(NSString *)aName email:(NSString *)aEmail;
59 59
 
60 60
 /*!
61  
-	@abstract Returns the name as a NSString
  61
+    @abstract Returns the name as a NSString
62 62
 */
63 63
 - (NSString *)name;
64 64
 -(NSString*)decodedName; // added by Gabor
65 65
 
66 66
 /*!
67  
-	@abstract Sets the name.
  67
+    @abstract Sets the name.
68 68
 */
69 69
 - (void)setName:(NSString *)aValue;
70 70
 
71 71
 /*!
72  
-	@abstract Returns the e-mail as a NSString
  72
+    @abstract Returns the e-mail as a NSString
73 73
 */
74 74
 - (NSString *)email;
75 75
 
76 76
 /*!
77  
-	@abstract Sets the e-mail.
  77
+    @abstract Sets the e-mail.
78 78
 */
79 79
 - (void)setEmail:(NSString *)aValue;
80 80
 
81 81
 /*!
82  
-	@abstract Works like the typical isEqual: method
  82
+    @abstract Works like the typical isEqual: method
83 83
 */
84 84
 - (BOOL)isEqual:(id)object;
85 85
 
86 86
 /*!
87  
-	@abstract Standard description method
  87
+    @abstract Standard description method
88 88
 */
89 89
 - (NSString *)description;
90 90
 @end
62  Source/CTCoreAddress.m
@@ -35,34 +35,34 @@
35 35
 
36 36
 @implementation CTCoreAddress
37 37
 + (id)address {
38  
-	CTCoreAddress *aAddress = [[CTCoreAddress alloc] init];
39  
-	return [aAddress autorelease];
  38
+    CTCoreAddress *aAddress = [[CTCoreAddress alloc] init];
  39
+    return [aAddress autorelease];
40 40
 }
41 41
 
42 42
 
43 43
 + (id)addressWithName:(NSString *)aName email:(NSString *)aEmail {
44  
-	CTCoreAddress *aAddress = [[CTCoreAddress alloc] initWithName:aName email:aEmail];
45  
-	return [aAddress autorelease];
  44
+    CTCoreAddress *aAddress = [[CTCoreAddress alloc] initWithName:aName email:aEmail];
  45
+    return [aAddress autorelease];
46 46
 }
47 47
 
48 48
 
49 49
 - (id)initWithName:(NSString *)aName email:(NSString *)aEmail {
50  
-	self = [super init];
51  
-	if (self) {
52  
-		[self setName:aName];
53  
-		[self setEmail:aEmail];
54  
-	}
55  
-	return self;
  50
+    self = [super init];
  51
+    if (self) {
  52
+        [self setName:aName];
  53
+        [self setEmail:aEmail];
  54
+    }
  55
+    return self;
56 56
 }
57 57
 
58 58
 
59 59
 - (id)init {
60  
-	self = [super init];