Skip to content

Commit 5785b8e

Browse files
author
Kevin Lefèvre
authored
Merge pull request #41 from klefevre/bump-version
Bump version
2 parents f42dc03 + f36fb41 commit 5785b8e

27 files changed

+125
-55
lines changed

.swift-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0.2

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "antitypical/Result" ~> 3.0.0
1+
github "antitypical/Result" ~> 3.1.0

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "antitypical/Result" "3.0.0"
1+
github "antitypical/Result" "3.1.0"

Postal.podspec

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Postal'
3-
s.version = '0.3.1'
3+
s.version = '0.4.0'
44
s.summary = 'A swift framework for working with emails.'
55
s.description = 'A Swift framework for working with emails. Simple and quick to use. Built on top of libetpan.'
66
s.homepage = 'https://github.com/snipsco/Postal'
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
1010
s.ios.deployment_target = '8.0'
1111
s.osx.deployment_target = '10.10'
1212

13-
s.source = { :git => 'https://github.com/snipsco/Postal.git', :tag => 'v' + s.version.to_s }
13+
s.source = { :git => 'https://github.com/klefevre/Postal.git', :tag => 'v' + s.version.to_s }
1414

1515
s.default_subspec = 'Core'
1616

@@ -33,13 +33,17 @@ Pod::Spec.new do |s|
3333
sp.preserve_paths = 'dependencies'
3434

3535
sp.libraries = 'etpan', 'sasl2', 'z', 'iconv'
36-
sp.dependency 'Result', '~> 3.0.0'
36+
sp.dependency 'Result', '~> 3.1.0'
3737
end
3838

3939
s.subspec 'ReactiveCocoa' do |sp|
40-
sp.source_files = 'Postal/ReactiveCocoa/*.swift'
41-
sp.dependency "Postal/Core"
42-
sp.dependency 'ReactiveCocoa', '~> 4.2.1'
40+
sp.dependency 'Postal/ReactiveSwift'
41+
end
42+
43+
s.subspec 'ReactiveSwift' do |sp|
44+
sp.source_files = 'Postal/ReactiveSwift/*.swift'
45+
sp.dependency 'Postal/Core'
46+
sp.dependency 'ReactiveSwift', '1.0.0-rc.3'
4347
end
4448

4549
end

Postal.xcodeproj/project.pbxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@
577577
isa = PBXProject;
578578
attributes = {
579579
LastSwiftUpdateCheck = 0730;
580-
LastUpgradeCheck = 0800;
580+
LastUpgradeCheck = 0820;
581581
ORGANIZATIONNAME = snips;
582582
TargetAttributes = {
583583
9812C31B1D50959500630D46 = {
@@ -958,6 +958,7 @@
958958
MTL_ENABLE_DEBUG_INFO = NO;
959959
PRODUCT_NAME = Postal;
960960
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/dependencies";
961+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
961962
SWIFT_VERSION = 2.3;
962963
TARGETED_DEVICE_FAMILY = "1,2";
963964
VALIDATE_PRODUCT = YES;

Postal.xcodeproj/xcshareddata/xcschemes/Postal-iOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0820"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "NO"

Postal.xcodeproj/xcshareddata/xcschemes/Postal-macOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0820"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "NO"

Postal/ReactiveCocoa/Postal+RAC.swift renamed to Postal/ReactiveSwift/Postal+RAC.swift

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
// SOFTWARE.
2323
//
2424

25-
import ReactiveCocoa
25+
import ReactiveSwift
2626

2727
public extension Postal {
2828
func rac_connect() -> SignalProducer<Void, PostalError> {
2929
return SignalProducer { observer, disposable in
3030
self.connect(timeout: Postal.defaultTimeout) { result in
3131
result.analysis(
3232
ifSuccess: {
33-
observer.sendNext(())
33+
observer.send(value: ())
3434
observer.sendCompleted()
3535
},
36-
ifFailure: observer.sendFailed)
36+
ifFailure: observer.send)
3737
}
3838
}
3939
}
@@ -43,10 +43,10 @@ public extension Postal {
4343
self.listFolders { result in
4444
result.analysis(
4545
ifSuccess: { folders in
46-
observer.sendNext(folders)
46+
observer.send(value: folders)
4747
observer.sendCompleted()
4848
},
49-
ifFailure: observer.sendFailed)
49+
ifFailure: observer.send)
5050
}
5151
}
5252
}
@@ -65,31 +65,31 @@ public extension Postal {
6565
}
6666
}
6767

68-
func rac_search(folder: String, filter: SearchKind) -> SignalProducer<NSIndexSet, PostalError> {
69-
return rac_search(folder, filter: .base(filter))
68+
func rac_search(folder: String, filter: SearchKind) -> SignalProducer<IndexSet, PostalError> {
69+
return rac_search(folder: folder, filter: .base(filter))
7070
}
7171

72-
func rac_search(folder: String, filter: SearchFilter) -> SignalProducer<NSIndexSet, PostalError> {
72+
func rac_search(folder: String, filter: SearchFilter) -> SignalProducer<IndexSet, PostalError> {
7373
return SignalProducer { observer, disposable in
7474
self.search(folder, filter: filter) { result in
7575
result.analysis(
7676
ifSuccess: { uids in
77-
observer.sendNext(uids)
77+
observer.send(value: uids)
7878
observer.sendCompleted()
7979
},
80-
ifFailure: observer.sendFailed)
80+
ifFailure: observer.send)
8181
}
8282
}
8383
}
8484

85-
func rac_fetch(folder: String, uids: NSIndexSet, flags: FetchFlag, extraHeaders: Set<String> = []) -> SignalProducer<FetchResult, PostalError> {
85+
func rac_fetch(folder: String, uids: IndexSet, flags: FetchFlag, extraHeaders: Set<String> = []) -> SignalProducer<FetchResult, PostalError> {
8686
return SignalProducer<FetchResult, PostalError> { observer, disposable in
8787
self.fetchMessages(folder, uids: uids, flags: flags, extraHeaders: extraHeaders,
8888
onMessage: { message in
89-
observer.sendNext(message)
89+
observer.send(value: message)
9090
}, onComplete: { error in
9191
if let error = error {
92-
observer.sendFailed(error)
92+
observer.send(error: error)
9393
} else {
9494
observer.sendCompleted()
9595
}
@@ -101,38 +101,45 @@ public extension Postal {
101101
return SignalProducer<MailData, PostalError> { observer, disposable in
102102
self.fetchAttachments(folder, uid: uid, partId: partId,
103103
onAttachment: { data in
104-
observer.sendNext(data)
104+
observer.send(value: data)
105105
},
106106
onComplete: { error in
107107
if let error = error {
108-
observer.sendFailed(error)
108+
observer.send(error: error)
109109
} else {
110110
observer.sendCompleted()
111111
}
112112
})
113113
}
114114
}
115115

116-
func rac_fetchTextualMail(folder: String, uids: NSIndexSet) -> SignalProducer<FetchResult, PostalError> {
117-
return rac_fetch(folder, uids: uids, flags: [ .structure, .fullHeaders ])
118-
.flatMap(.Concat) { (fetchResult: FetchResult) -> SignalProducer<FetchResult, PostalError> in
116+
func rac_fetchTextualMail(folder: String, uids: IndexSet) -> SignalProducer<FetchResult, PostalError> {
117+
return rac_fetch(folder: folder, uids: uids, flags: [ .structure, .fullHeaders ])
118+
.flatMap(.concat) { (fetchResult: FetchResult) -> SignalProducer<FetchResult, PostalError> in
119119
let inlineElements = fetchResult.body?.allParts.filter { singlePart in
120-
if case .Some(.attachment) = singlePart.mimeFields.contentDisposition { return false }
120+
if case .some(.attachment) = singlePart.mimeFields.contentDisposition { return false }
121121
return [ "text/html", "text/plain" ].contains("\(singlePart.mimeType)")
122122
} ?? []
123123

124-
return SignalProducer<SinglePart, PostalError>(values: inlineElements)
125-
.flatMap(.Merge) { (singlePart: SinglePart) -> SignalProducer<(String, MailData), PostalError> in
126-
return self.rac_fetchAttachment(folder, uid: fetchResult.uid, partId: singlePart.id).map { (singlePart.id, $0) }
124+
return SignalProducer<SinglePart, PostalError>(inlineElements)
125+
.flatMap(.merge) { (singlePart: SinglePart) -> SignalProducer<(String, MailData), PostalError> in
126+
return self.rac_fetchAttachment(folder: folder, uid: fetchResult.uid, partId: singlePart.id).map { (singlePart.id, $0) }
127127
}
128128
.collect()
129-
.map { fetchResult.mergeAttachments(Dictionary(elements: $0)) }
129+
.map { fetchResult.mergeAttachments(attachments: Dictionary<String, MailData>($0)) }
130130
}
131131
}
132132
}
133133

134134
private extension Dictionary {
135-
init<S: SequenceType where S.Generator.Element == Element>(elements: S) {
135+
init<S: Sequence>(_ seq: S) where S.Iterator.Element == (Key, Value) {
136+
self.init()
137+
for (k, v) in seq {
138+
self[k] = v
139+
}
140+
}
141+
142+
init<S: Sequence>(elements: S) where S.Iterator.Element == Element {
136143
self.init()
137144
for (k, v) in elements {
138145
self[k] = v
@@ -145,7 +152,7 @@ private extension FetchResult {
145152
return FetchResult(uid: uid,
146153
header: header,
147154
flags: flags,
148-
body: body?.mergeAttachments(attachments),
155+
body: body?.mergeAttachments(attachments: attachments),
149156
rfc822Size: rfc822Size,
150157
internalDate: internalDate,
151158
gmailThreadId: gmailThreadId,
@@ -163,9 +170,9 @@ private extension MailPart {
163170
}
164171
return self
165172
case .multipart(let id, let mimeType, let parts):
166-
return .multipart(id: id, mimeType: mimeType, parts: parts.map { $0.mergeAttachments(attachments) })
173+
return .multipart(id: id, mimeType: mimeType, parts: parts.map { $0.mergeAttachments(attachments: attachments) })
167174
case .message(let id, let header, let message):
168-
return .message(id: id, header: header, message: message.mergeAttachments(attachments))
175+
return .message(id: id, header: header, message: message.mergeAttachments(attachments: attachments))
169176
}
170177
}
171178
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ Postal also can be used by [CocoaPods](https://cocoapods.org/).
104104
pod "Postal"
105105
```
106106

107-
- For ReactiveCocoa extensions, this project will include them as dependencies. You can do this via CocoaPods subspecs.
107+
- For ReactiveSwift extensions, this project will include them as dependencies. You can do this via CocoaPods subspecs.
108108

109109
```ruby
110-
pod 'Postal/ReactiveCocoa'
110+
pod 'Postal/ReactiveSwift'
111111
```
112112

113113
- Run `pod install`.

dependencies/build-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ popd > /dev/null
66

77
# configuration
88
url="https://github.com/snipsco/libetpan.git"
9-
rev=97595a27d22b45fe8c22f112235490d6750edd20
9+
rev=6a08017f1c742f0c5817d6c1c71143a37da967be
1010

1111
ios_target="libetpan ios"
1212
macos_target="static libetpan"

dependencies/build/git-rev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
97595a27d22b45fe8c22f112235490d6750edd20
1+
6a08017f1c742f0c5817d6c1c71143a37da967be

dependencies/build/ios/include/libetpan/mailimap.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,27 @@ int mailimap_hack_date_time_parse(const char * str,
913913
size_t progr_rate,
914914
progress_function * progr_fun);
915915

916+
#ifndef LIBETPAN_HAS_MAILIMAP_QIP_WORKAROUND
917+
#define LIBETPAN_HAS_MAILIMAP_QIP_WORKAROUND 1
918+
#endif
919+
920+
/*
921+
Enable workaround for QIP IMAP server.
922+
923+
QIP returns invalid (?) response for storeFlags operation:
924+
C: A999 UID STORE 123 +FLAGS.SILENT (\Seen)
925+
S: * 6 FETCH ()
926+
S: A999 OK STORE completed
927+
928+
Enabling this workaround allows successfully parse such responses.
929+
*/
930+
931+
LIBETPAN_EXPORT
932+
int mailimap_is_qip_workaround_enabled(mailimap * session);
933+
934+
LIBETPAN_EXPORT
935+
void mailimap_set_qip_workaround_enabled(mailimap * session, int enabled);
936+
916937
#ifdef __cplusplus
917938
}
918939
#endif

dependencies/build/ios/include/libetpan/mailimap_types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3393,6 +3393,7 @@ struct mailimap {
33933393

33943394
int is_163_workaround_enabled;
33953395
int is_rambler_workaround_enabled;
3396+
int is_qip_workaround_enabled;
33963397
};
33973398

33983399

@@ -3576,6 +3577,7 @@ enum {
35763577

35773578
struct mailimap_parser_context {
35783579
int is_rambler_workaround_enabled;
3580+
int is_qip_workaround_enabled;
35793581

35803582
mailimap_msg_body_handler * msg_body_handler;
35813583
void * msg_body_handler_context;
@@ -3596,6 +3598,10 @@ LIBETPAN_EXPORT
35963598
int
35973599
mailimap_parser_context_is_rambler_workaround_enabled(struct mailimap_parser_context * parser_ctx);
35983600

3601+
LIBETPAN_EXPORT
3602+
int
3603+
mailimap_parser_context_is_qip_workaround_enabled(struct mailimap_parser_context * parser_ctx);
3604+
35993605
#ifdef __cplusplus
36003606
}
36013607
#endif

dependencies/build/ios/include/sasl/prop.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,23 @@
3434
* as extern. (Technically, we don't even have to do that.) */
3535
#ifdef WIN32
3636
# ifdef LIBSASL_EXPORTS
37-
# define LIBSASL_API __declspec(dllexport)
37+
# define LIBSASL_API extern __declspec(dllexport)
3838
# else /* LIBSASL_EXPORTS */
39-
# define LIBSASL_API __declspec(dllimport)
39+
# define LIBSASL_API extern __declspec(dllimport)
4040
# endif /* LIBSASL_EXPORTS */
4141
#else /* WIN32 */
4242
# define LIBSASL_API extern
4343
#endif /* WIN32 */
4444

45-
/* Same as above, but used during a variable declaration. Only Unix definition
46-
* is different, as we can't assign an initial value to an extern variable */
45+
/* Same as above, but used during a variable declaration. */
4746
#ifdef WIN32
4847
# ifdef LIBSASL_EXPORTS
49-
# define LIBSASL_VAR __declspec(dllexport)
48+
# define LIBSASL_VAR extern __declspec(dllexport)
5049
# else /* LIBSASL_EXPORTS */
51-
# define LIBSASL_VAR __declspec(dllimport)
50+
# define LIBSASL_VAR extern __declspec(dllimport)
5251
# endif /* LIBSASL_EXPORTS */
5352
#else /* WIN32 */
54-
# define LIBSASL_VAR
53+
# define LIBSASL_VAR extern
5554
#endif /* WIN32 */
5655

5756
/* the resulting structure for property values

dependencies/build/ios/include/sasl/sasl.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
/* Keep in sync with win32/common.mak */
125125
#define SASL_VERSION_MAJOR 2
126126
#define SASL_VERSION_MINOR 1
127-
#define SASL_VERSION_STEP 25
127+
#define SASL_VERSION_STEP 26
128128

129129
/* A convenience macro: same as was defined in the OpenLDAP LDAPDB */
130130
#define SASL_VERSION_FULL ((SASL_VERSION_MAJOR << 16) |\
@@ -225,9 +225,9 @@ extern "C" {
225225

226226
/* memory allocation functions which may optionally be replaced:
227227
*/
228-
typedef void *sasl_malloc_t(unsigned long);
229-
typedef void *sasl_calloc_t(unsigned long, unsigned long);
230-
typedef void *sasl_realloc_t(void *, unsigned long);
228+
typedef void *sasl_malloc_t(size_t);
229+
typedef void *sasl_calloc_t(size_t, size_t);
230+
typedef void *sasl_realloc_t(void *, size_t);
231231
typedef void sasl_free_t(void *);
232232

233233
LIBSASL_API void sasl_set_alloc(sasl_malloc_t *,
@@ -633,8 +633,10 @@ typedef int sasl_server_userdb_setpass_t(sasl_conn_t *conn,
633633
/* One of the following two is required */
634634
#define SASL_CU_AUTHID 0x01
635635
#define SASL_CU_AUTHZID 0x02
636+
636637
/* Combine the following with SASL_CU_AUTHID, if you don't want
637-
to fail if auxprop returned SASL_NOUSER */
638+
to fail if auxprop returned SASL_NOUSER/SASL_NOMECH.
639+
This flag has no effect on SASL_CU_AUTHZID. */
638640
#define SASL_CU_EXTERNALLY_VERIFIED 0x04
639641

640642
#define SASL_CU_OVERRIDE 0x08 /* mapped to SASL_AUXPROP_OVERRIDE */

dependencies/build/ios/include/sasl/saslutil.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ LIBSASL_API char *sasl_strlower (char *val);
8282

8383
LIBSASL_API int sasl_config_init(const char *filename);
8484

85+
LIBSASL_API void sasl_config_done(void);
86+
8587
#ifdef WIN32
8688
/* Just in case a different DLL defines this as well */
8789
#if defined(NEED_GETOPT)

dependencies/build/ios/lib/libetpan.a

-264 KB
Binary file not shown.

dependencies/build/ios/lib/libsasl2.a

-61.2 KB
Binary file not shown.
-6.18 KB
Binary file not shown.
-7.78 KB
Binary file not shown.
-6.2 KB
Binary file not shown.
-6.69 KB
Binary file not shown.
-9.13 KB
Binary file not shown.

0 commit comments

Comments
 (0)