Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 64b4ae9

Browse files
authored
Merge pull request #2202 from RocketChat/develop
[RELEASE] Merge DEVELOP into MASTER
2 parents 5d0b02d + 23576a3 commit 64b4ae9

File tree

123 files changed

+840
-430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+840
-430
lines changed

Podfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def ui_pods
1414
end
1515

1616
def diff_pods
17-
pod 'DifferenceKit'
17+
pod 'DifferenceKit/Core'
1818
end
1919

2020
def shared_pods
@@ -77,18 +77,25 @@ target 'Rocket.ChatTests' do
7777
end
7878

7979
post_install do |installer|
80-
swift4Targets = ['OAuthSwift', 'TagListView', 'SearchTextField', 'Nuke', 'Nuke-FLAnimatedImage-Plugin', 'DifferenceKit', 'SwipeCellKit']
80+
swift3Targets = ['MobilePlayer', 'RCMarkdownParser']
81+
swift42Targets = ['SwipeCellKit']
8182
installer.pods_project.targets.each do |target|
8283
target.build_configurations.each do |config|
83-
config.build_settings['SWIFT_VERSION'] = '3.1'
84+
config.build_settings['SWIFT_VERSION'] = '4.1'
8485
if config.name == 'Debug'
85-
config.build_settings['OTHER_SWIFT_FLAGS'] = ['$(inherited)', '-Onone']
86+
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
87+
else
8688
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Owholemodule'
8789
end
8890
end
89-
if swift4Targets.include? target.name
91+
if swift3Targets.include? target.name
9092
target.build_configurations.each do |config|
91-
config.build_settings['SWIFT_VERSION'] = '4.0'
93+
config.build_settings['SWIFT_VERSION'] = '3.1'
94+
end
95+
end
96+
if swift42Targets.include? target.name
97+
target.build_configurations.each do |config|
98+
config.build_settings['SWIFT_VERSION'] = '4.2'
9299
end
93100
end
94101
end

Podfile.lock

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@ PODS:
22
- 1PasswordExtension (1.8.5)
33
- Crashlytics (3.10.7):
44
- Fabric (~> 1.7.11)
5-
- DifferenceKit (0.5.3):
6-
- DifferenceKit/Core (= 0.5.3)
7-
- DifferenceKit/UIExtensions (= 0.5.3)
85
- DifferenceKit/Core (0.5.3)
9-
- DifferenceKit/UIExtensions (0.5.3):
10-
- DifferenceKit/Core
116
- Fabric (1.7.11)
12-
- Firebase/Core (5.7.0):
7+
- Firebase/Core (5.8.0):
138
- Firebase/CoreOnly
14-
- FirebaseAnalytics (= 5.1.1)
15-
- Firebase/CoreOnly (5.7.0):
16-
- FirebaseCore (= 5.1.2)
17-
- FirebaseAnalytics (5.1.1):
9+
- FirebaseAnalytics (= 5.1.2)
10+
- Firebase/CoreOnly (5.8.0):
11+
- FirebaseCore (= 5.1.3)
12+
- FirebaseAnalytics (5.1.2):
1813
- FirebaseCore (~> 5.1)
1914
- FirebaseInstanceID (~> 3.2)
2015
- GoogleAppMeasurement (~> 5.1)
@@ -23,34 +18,34 @@ PODS:
2318
- GoogleUtilities/Network (~> 5.2)
2419
- "GoogleUtilities/NSData+zlib (~> 5.2)"
2520
- nanopb (~> 0.3)
26-
- FirebaseCore (5.1.2):
21+
- FirebaseCore (5.1.3):
2722
- GoogleUtilities/Logger (~> 5.2)
2823
- FirebaseInstanceID (3.2.1):
2924
- FirebaseCore (~> 5.1)
3025
- GoogleUtilities/Environment (~> 5.2)
3126
- FLAnimatedImage (1.0.12)
3227
- FLEX (2.4.0)
33-
- GoogleAppMeasurement (5.1.1):
28+
- GoogleAppMeasurement (5.1.2):
3429
- GoogleUtilities/AppDelegateSwizzler (~> 5.2.0)
3530
- GoogleUtilities/MethodSwizzler (~> 5.2.0)
3631
- GoogleUtilities/Network (~> 5.2)
3732
- "GoogleUtilities/NSData+zlib (~> 5.2)"
3833
- nanopb (~> 0.3)
39-
- GoogleUtilities/AppDelegateSwizzler (5.2.2):
34+
- GoogleUtilities/AppDelegateSwizzler (5.2.3):
4035
- GoogleUtilities/Environment
4136
- GoogleUtilities/Logger
4237
- GoogleUtilities/Network
43-
- GoogleUtilities/Environment (5.2.2)
44-
- GoogleUtilities/Logger (5.2.2):
38+
- GoogleUtilities/Environment (5.2.3)
39+
- GoogleUtilities/Logger (5.2.3):
4540
- GoogleUtilities/Environment
46-
- GoogleUtilities/MethodSwizzler (5.2.2):
41+
- GoogleUtilities/MethodSwizzler (5.2.3):
4742
- GoogleUtilities/Logger
48-
- GoogleUtilities/Network (5.2.2):
43+
- GoogleUtilities/Network (5.2.3):
4944
- GoogleUtilities/Logger
5045
- "GoogleUtilities/NSData+zlib"
5146
- GoogleUtilities/Reachability
52-
- "GoogleUtilities/NSData+zlib (5.2.2)"
53-
- GoogleUtilities/Reachability (5.2.2):
47+
- "GoogleUtilities/NSData+zlib (5.2.3)"
48+
- GoogleUtilities/Reachability (5.2.3):
5449
- GoogleUtilities/Logger
5550
- MBProgressHUD (1.1.0)
5651
- MobilePlayer (1.2.0)
@@ -66,24 +61,24 @@ PODS:
6661
- OAuthSwift (1.2.2)
6762
- RCMarkdownParser (3.0.6)
6863
- ReachabilitySwift (4.2.1)
69-
- Realm (3.7.6):
70-
- Realm/Headers (= 3.7.6)
71-
- Realm/Headers (3.7.6)
72-
- RealmSwift (3.7.6):
73-
- Realm (= 3.7.6)
64+
- Realm (3.9.0):
65+
- Realm/Headers (= 3.9.0)
66+
- Realm/Headers (3.9.0)
67+
- RealmSwift (3.9.0):
68+
- Realm (= 3.9.0)
7469
- semver (1.1.0)
7570
- SimpleImageViewer (1.2.0):
7671
- FLAnimatedImage
7772
- SlackTextViewController (1.9.6)
7873
- Starscream (2.1.1)
7974
- SwiftLint (0.27.0)
8075
- SwiftyJSON (4.1.0)
81-
- SwipeCellKit (2.4.3)
76+
- SwipeCellKit (2.5.0)
8277

8378
DEPENDENCIES:
8479
- 1PasswordExtension
8580
- Crashlytics
86-
- DifferenceKit
81+
- DifferenceKit/Core
8782
- Fabric
8883
- Firebase/Core
8984
- FLEX (~> 2.0)
@@ -160,14 +155,14 @@ SPEC CHECKSUMS:
160155
Crashlytics: ccaac42660eb9351b9960c0d66106b0bcf99f4fa
161156
DifferenceKit: 2037137305c55a39ff729baa72697efa30b1052d
162157
Fabric: f233c9492b3bbc1f04e3882986740f7988a58edb
163-
Firebase: 734a4f92957aa6c40e7ae3fda3d9359e1890aa87
164-
FirebaseAnalytics: 993577e91157feb40945abedd6ab346d8a4b6ac8
165-
FirebaseCore: 3a97432acb324b439fbed338e642f9cbb516a63d
158+
Firebase: 25812f43e7a53b11ae2f0a5f4c6d12faeb1f7cd7
159+
FirebaseAnalytics: df15839e9c6ca6bd14d2e8ab6b0c672e6c49097e
160+
FirebaseCore: 27bd80e5bfaaf9552a1f5cacb4c7e8bb925bab22
166161
FirebaseInstanceID: ea5af6920d0a4a29b40459d055bebe4a6c1333c4
167162
FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
168163
FLEX: bd1a39e55b56bb413b6f1b34b3c10a0dc44ef079
169-
GoogleAppMeasurement: f7507b39b70ad0bd80b3d81518b2f43868974307
170-
GoogleUtilities: 06b66f9567769a7958db20a92f0128b2843e49d5
164+
GoogleAppMeasurement: fc4a4c3fe0144db9313cbf443ffe62e6b1d6268c
165+
GoogleUtilities: 6f681e27050c5e130325e89fa0316dfca826f954
171166
MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
172167
MobilePlayer: 069b13482499f14c25b6ce53f63a91e17975b073
173168
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
@@ -176,16 +171,16 @@ SPEC CHECKSUMS:
176171
OAuthSwift: 27b34fe80b76b67cd8f45571e0be2432bc9f6de1
177172
RCMarkdownParser: 518b616a4f48bb02247243544d4fd55c048288a4
178173
ReachabilitySwift: 35720ffea59c1c76d15f885be77fd33e33985427
179-
Realm: 9eaecad54712d6246d08ba34c10f354e4715d7d3
180-
RealmSwift: 1fe08b4ebaeeaacf17f9ba0343f7b25c9fc31fa6
174+
Realm: 3d36f208bf3aff8335dc3298742140182bde4edb
175+
RealmSwift: aa4d11917bfcfaa3ed51f219102a487ecd895447
181176
semver: 11ae3bc4a6036efbc86b5863ef5fa32c065c8bbd
182177
SimpleImageViewer: 6ed0d2acf7c166a5b4e795bccc7b9ea1b225ff9b
183178
SlackTextViewController: b854e62c1c156336bc4fd409c6ca79b5773e8f9d
184179
Starscream: 142bd8ef24592d985daee9fa48c936070b85b15f
185180
SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073
186181
SwiftyJSON: c29297daf073d2aa016295d5809cdd68045c39b3
187-
SwipeCellKit: cee9906e6d3a36e22ad1a852fba7f8fa0839d113
182+
SwipeCellKit: d8f2617538ce3021cb0a11d1b93856a06a2f2e20
188183

189-
PODFILE CHECKSUM: 6702db159e15966472657eea05905247ba9622d9
184+
PODFILE CHECKSUM: 6b8602cb3bfdb2d5969e91f6f161923d47884c5c
190185

191186
COCOAPODS: 1.5.3

Rocket.Chat.ShareExtension/Base/SENavigationController.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import MobileCoreServices
1111

1212
final class SENavigationController: UINavigationController {
1313
func loadContent(_ store: SEStore) -> SEAction? {
14-
let itemProviders = (extensionContext?.inputItems.first as? NSExtensionItem)?.attachments?.compactMap {
15-
$0 as? NSItemProvider
16-
} ?? []
14+
let itemProviders = (extensionContext?.inputItems.first as? NSExtensionItem)?.attachments ?? []
1715

1816
parseItemProviders(store, itemProviders)
1917
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
@@ -40,15 +38,15 @@ final class SENavigationController: UINavigationController {
4038

4139
view.transform = CGAffineTransform(translationX: 0, y: view.frame.size.height)
4240

43-
UIView.animate(withDuration: 0.25, delay: 0, options: UIViewAnimationOptions(rawValue: 7 << 16), animations: { [weak self] in
41+
UIView.animate(withDuration: 0.25, delay: 0, options: UIView.AnimationOptions(rawValue: 7 << 16), animations: { [weak self] in
4442
self?.view.transform = CGAffineTransform.identity
4543
}, completion: nil)
4644

4745
store.subscribe(self)
4846
}
4947

5048
private func completeRequest() {
51-
UIView.animate(withDuration: 0.20, delay: 0, options: UIViewAnimationOptions(rawValue: 7 << 16), animations: { [weak self] in
49+
UIView.animate(withDuration: 0.20, delay: 0, options: UIView.AnimationOptions(rawValue: 7 << 16), animations: { [weak self] in
5250
self?.view.transform = CGAffineTransform(translationX: 0, y: self?.view.frame.height ?? 0)
5351
}, completion: { [weak self] _ in
5452
self?.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)

Rocket.Chat.ShareExtension/Base/SEViewController.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ enum SEError: Error {
1616
class SEViewController: UIViewController, SEStoreSubscriber {
1717

1818
lazy var activityIndicator: UIActivityIndicatorView = {
19-
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.whiteLarge)
19+
let activityIndicator = UIActivityIndicatorView(style: .whiteLarge)
2020
activityIndicator.frame = CGRect(x: 0, y: 0, width: 80, height: 80)
2121
activityIndicator.layer.cornerRadius = 10
2222
activityIndicator.backgroundColor = UIColor.black.withAlphaComponent(0.5)
@@ -67,7 +67,7 @@ class SEViewController: UIViewController, SEStoreSubscriber {
6767
NotificationCenter.default.addObserver(
6868
self,
6969
selector: #selector(onKeyboardFrameWillChange(_:)),
70-
name: NSNotification.Name.UIKeyboardWillChangeFrame,
70+
name: UIResponder.keyboardWillChangeFrameNotification,
7171
object: nil
7272
)
7373

@@ -77,15 +77,15 @@ class SEViewController: UIViewController, SEStoreSubscriber {
7777
func stopAvoidingKeyboard() {
7878
NotificationCenter.default.removeObserver(
7979
self,
80-
name: NSNotification.Name.UIKeyboardWillChangeFrame,
80+
name: UIResponder.keyboardWillChangeFrameNotification,
8181
object: nil
8282
)
8383
}
8484

8585
@objc func onKeyboardFrameWillChange(_ notification: Notification) {
8686
guard
8787
let userInfo = notification.userInfo,
88-
let keyboardFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue
88+
let keyboardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue
8989
else {
9090
return
9191
}
@@ -94,10 +94,10 @@ class SEViewController: UIViewController, SEStoreSubscriber {
9494
let safeAreaFrame = view.safeAreaLayoutGuide.layoutFrame.insetBy(dx: 0, dy: -additionalSafeAreaInsets.bottom)
9595
let intersection = safeAreaFrame.intersection(keyboardFrameInView)
9696

97-
let animationDuration: TimeInterval = (notification.userInfo?[UIKeyboardAnimationDurationUserInfoKey] as? NSNumber)?.doubleValue ?? 0
98-
let animationCurveRawNSN = notification.userInfo?[UIKeyboardAnimationCurveUserInfoKey] as? NSNumber
99-
let animationCurveRaw = animationCurveRawNSN?.uintValue ?? UIViewAnimationOptions.curveEaseInOut.rawValue
100-
let animationCurve = UIViewAnimationOptions(rawValue: animationCurveRaw)
97+
let animationDuration: TimeInterval = (notification.userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? NSNumber)?.doubleValue ?? 0
98+
let animationCurveRawNSN = notification.userInfo?[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber
99+
let animationCurveRaw = animationCurveRawNSN?.uintValue ?? UIView.AnimationOptions.curveEaseInOut.rawValue
100+
let animationCurve = UIView.AnimationOptions(rawValue: animationCurveRaw)
101101

102102
UIView.animate(withDuration: animationDuration, delay: 0, options: animationCurve, animations: {
103103
let keyboardDisappeared = keyboardFrameInView == .zero

Rocket.Chat.ShareExtension/Compose/Cells/SEComposeFileCell.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SEComposeFileCell: UICollectionViewCell, SECell {
3434
let textField = UITextField(
3535
frame: CGRect(x: 20, y: 0, width: tableView.bounds.width - 16, height: cellModel.nameHeight)
3636
)
37-
NotificationCenter.default.addObserver(self, selector: #selector(nameDidChange(_:)), name: .UITextFieldTextDidChange, object: textField)
37+
NotificationCenter.default.addObserver(self, selector: #selector(nameDidChange(_:)), name: UITextField.textDidChangeNotification, object: textField)
3838
return textField
3939
}()
4040

@@ -43,7 +43,7 @@ class SEComposeFileCell: UICollectionViewCell, SECell {
4343
frame: CGRect(x: 16, y: 0, width: tableView.bounds.width - 16, height: cellModel.descriptionHeight)
4444
)
4545
textView.font = nameTextField.font
46-
NotificationCenter.default.addObserver(self, selector: #selector(descriptionDidChange(_:)), name: .UITextViewTextDidChange, object: textView)
46+
NotificationCenter.default.addObserver(self, selector: #selector(descriptionDidChange(_:)), name: UITextView.textDidChangeNotification, object: textView)
4747
return textView
4848
}()
4949

Rocket.Chat.ShareExtension/External/KMPlaceholderTextView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ open class KMPlaceholderTextView: UITextView {
2929
private struct Constants {
3030
static let defaultiOSPlaceholderColor = UIColor(red: 0.0, green: 0.0, blue: 0.0980392, alpha: 0.22)
3131
}
32-
open let placeholderLabel: UILabel = UILabel()
32+
public let placeholderLabel: UILabel = UILabel()
3333

3434
private var placeholderLabelConstraints = [NSLayoutConstraint]()
3535

@@ -97,7 +97,7 @@ open class KMPlaceholderTextView: UITextView {
9797
private func commonInit() {
9898
NotificationCenter.default.addObserver(self,
9999
selector: #selector(textDidChange),
100-
name: NSNotification.Name.UITextViewTextDidChange,
100+
name: UITextView.textDidChangeNotification,
101101
object: nil)
102102

103103
placeholderLabel.font = font
@@ -145,7 +145,7 @@ open class KMPlaceholderTextView: UITextView {
145145

146146
deinit {
147147
NotificationCenter.default.removeObserver(self,
148-
name: NSNotification.Name.UITextViewTextDidChange,
148+
name: UITextView.textDidChangeNotification,
149149
object: nil)
150150
}
151151

Rocket.Chat.ShareExtension/Helpers/VideoInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct VideoInfo {
2727
let generator = AVAssetImageGenerator(asset: asset)
2828
generator.appliesPreferredTrackTransform = true
2929

30-
guard let cgImage = try? generator.copyCGImage(at: CMTimeMake(0, 1), actualTime: nil) else {
30+
guard let cgImage = try? generator.copyCGImage(at: CMTimeMake(value: 0, timescale: 1), actualTime: nil) else {
3131
return nil
3232
}
3333

Rocket.Chat.ShareExtension/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>XPC!</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>3.1.0</string>
20+
<string>3.1.1</string>
2121
<key>CFBundleVersion</key>
22-
<string>210</string>
22+
<string>214</string>
2323
<key>ITSEncryptionExportComplianceCode</key>
2424
<string></string>
2525
<key>NSExtension</key>

Rocket.Chat.ShareExtension/State/ActionCreators/ParseItemProviders.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ extension NSItemProvider {
6969

7070
image = image.resizeWith(width: 1024) ?? image
7171

72-
if let data = UIImageJPEGRepresentation(image, 0.9) {
72+
if let data = image.jpegData(compressionQuality: 0.9) {
7373
let file = SEFile(name: name, description: "", mimetype: "image/jpeg", data: data, fileUrl: item as? URL)
7474
let content = store.state.content + [SEContent(type: .file(file))]
7575
DispatchQueue.main.async {

0 commit comments

Comments
 (0)