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

Commit da997c4

Browse files
authored
Merge pull request #2044 from RocketChat/develop
[RELEASE] Merge DEVELOP into BETA
2 parents 6b08a18 + 0bf836e commit da997c4

55 files changed

Lines changed: 580 additions & 753 deletions

File tree

Some content is hidden

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

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.0.0</string>
20+
<string>3.0.1</string>
2121
<key>CFBundleVersion</key>
22-
<string>191</string>
22+
<string>199</string>
2323
<key>ITSEncryptionExportComplianceCode</key>
2424
<string></string>
2525
<key>NSExtension</key>

Rocket.Chat.xcodeproj/project.pbxproj

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
335F4F03207A31D3005E14AF /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335F4F02207A31D3005E14AF /* NotificationManager.swift */; };
104104
3397604920EA72EE0054758A /* RuntimeAttributesThemeableViewSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3397604820EA72EE0054758A /* RuntimeAttributesThemeableViewSpec.swift */; };
105105
339B692B2050449700F97392 /* KeyboardFrameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 339B6929205042D300F97392 /* KeyboardFrameView.swift */; };
106+
33A1BB0520FE312900AFA7D4 /* ChatMessageVideoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 412A95D51FD94ED000954AA6 /* ChatMessageVideoView.xib */; };
107+
33A1BB0720FF75D600AFA7D4 /* BaseSubscriptionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33A1BB0620FF75D600AFA7D4 /* BaseSubscriptionCell.swift */; };
106108
33A5C9BE206A561400FE1C8F /* emojiNames.json in Resources */ = {isa = PBXBuildFile; fileRef = 33A5C9BD206A561400FE1C8F /* emojiNames.json */; };
107109
33A5C9CA206A565800FE1C8F /* symbols.json in Resources */ = {isa = PBXBuildFile; fileRef = 33A5C9C1206A565800FE1C8F /* symbols.json */; };
108110
33A5C9CB206A565800FE1C8F /* travel.json in Resources */ = {isa = PBXBuildFile; fileRef = 33A5C9C2206A565800FE1C8F /* travel.json */; };
@@ -177,7 +179,6 @@
177179
412731D51DE0A55C00FC45A0 /* ChatPreviewModeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 412731D41DE0A55C00FC45A0 /* ChatPreviewModeView.xib */; };
178180
412731D71DE0A89B00FC45A0 /* ChatPreviewModeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 412731D61DE0A89B00FC45A0 /* ChatPreviewModeView.swift */; };
179181
412A95D61FD94ED000954AA6 /* ChatMessageVideoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 412A95D41FD94ED000954AA6 /* ChatMessageVideoView.swift */; };
180-
412A95D71FD94ED000954AA6 /* ChatMessageVideoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 412A95D51FD94ED000954AA6 /* ChatMessageVideoView.xib */; };
181182
412BCC851E55C6A300F7F4EE /* ChatMessageTextView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 412BCC841E55C6A300F7F4EE /* ChatMessageTextView.xib */; };
182183
412BCC871E55C6B800F7F4EE /* ChatMessageTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 412BCC861E55C6B800F7F4EE /* ChatMessageTextView.swift */; };
183184
412BCC8B1E55D4AA00F7F4EE /* UIColorCSSColorsExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 412BCC8A1E55D4AA00F7F4EE /* UIColorCSSColorsExtension.swift */; };
@@ -736,7 +737,6 @@
736737
B5893BF61F6C4B1D00365768 /* UserReviewManagerSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5893BF51F6C4B1D00365768 /* UserReviewManagerSpec.swift */; };
737738
D10E9C1A1F643457007F1796 /* Channel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10E9C191F643457007F1796 /* Channel.swift */; };
738739
D10E9C1E1F643474007F1796 /* ChannelModelMapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10E9C1D1F643474007F1796 /* ChannelModelMapping.swift */; };
739-
D10E9C201F6434A7007F1796 /* NSRangeExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10E9C1F1F6434A7007F1796 /* NSRangeExtensions.swift */; };
740740
D10E9C221F643616007F1796 /* MentionModelMapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10E9C211F643616007F1796 /* MentionModelMapping.swift */; };
741741
D12D34031F69C76400AED992 /* SubscriptionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12D34021F69C76400AED992 /* SubscriptionExtensions.swift */; };
742742
D1411A2A1F6777F300D6EDF7 /* ChannelSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1411A291F6777F300D6EDF7 /* ChannelSpec.swift */; };
@@ -903,6 +903,7 @@
903903
335F4F02207A31D3005E14AF /* NotificationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationManager.swift; sourceTree = "<group>"; };
904904
3397604820EA72EE0054758A /* RuntimeAttributesThemeableViewSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeAttributesThemeableViewSpec.swift; sourceTree = "<group>"; };
905905
339B6929205042D300F97392 /* KeyboardFrameView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyboardFrameView.swift; sourceTree = "<group>"; };
906+
33A1BB0620FF75D600AFA7D4 /* BaseSubscriptionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseSubscriptionCell.swift; sourceTree = "<group>"; };
906907
33A5C9BD206A561400FE1C8F /* emojiNames.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = emojiNames.json; sourceTree = "<group>"; };
907908
33A5C9C1206A565800FE1C8F /* symbols.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = symbols.json; sourceTree = "<group>"; };
908909
33A5C9C2206A565800FE1C8F /* travel.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = travel.json; sourceTree = "<group>"; };
@@ -1539,7 +1540,6 @@
15391540
BCF38696E8EC385488688390 /* Pods-Rocket.Chat.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Rocket.Chat.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Rocket.Chat/Pods-Rocket.Chat.debug.xcconfig"; sourceTree = "<group>"; };
15401541
D10E9C191F643457007F1796 /* Channel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Channel.swift; sourceTree = "<group>"; };
15411542
D10E9C1D1F643474007F1796 /* ChannelModelMapping.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChannelModelMapping.swift; sourceTree = "<group>"; };
1542-
D10E9C1F1F6434A7007F1796 /* NSRangeExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSRangeExtensions.swift; sourceTree = "<group>"; };
15431543
D10E9C211F643616007F1796 /* MentionModelMapping.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MentionModelMapping.swift; sourceTree = "<group>"; };
15441544
D12D34021F69C76400AED992 /* SubscriptionExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionExtensions.swift; sourceTree = "<group>"; };
15451545
D1411A291F6777F300D6EDF7 /* ChannelSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChannelSpec.swift; sourceTree = "<group>"; };
@@ -2235,7 +2235,6 @@
22352235
41E991D31D343A9F00BDDCA8 /* DateExtension.swift */,
22362236
77CCB6BD1F8D0597004BBF67 /* DictionaryExtensions.swift */,
22372237
41FC9E07209B3A6300FED485 /* NSAttributedStringExtensions.swift */,
2238-
D10E9C1F1F6434A7007F1796 /* NSRangeExtensions.swift */,
22392238
80A2A2AA2073BD0800857DAF /* RealmCurrent.swift */,
22402239
8076FDA8204853DE00114F28 /* RealmExecute.swift */,
22412240
8076FDA32048533000114F28 /* String+Random.swift */,
@@ -2304,6 +2303,7 @@
23042303
4147CE7C1F5EAAB300C322C3 /* ServerCell.swift */,
23052304
41FBF4EA20BD8C650080D00D /* ServerCell.xib */,
23062305
4192054B1D52F4FC004EEC5F /* SubscriptionCell.swift */,
2306+
33A1BB0620FF75D600AFA7D4 /* BaseSubscriptionCell.swift */,
23072307
41778EB820ED4C2C007F72F9 /* SubscriptionCellCondensed.swift */,
23082308
41DE687C20C6D57F00AA5EC8 /* SubscriptionSortingCell.swift */,
23092309
41DE688020C6EBE600AA5EC8 /* SubscriptionSortingCell.xib */,
@@ -3677,7 +3677,7 @@
36773677
isa = PBXProject;
36783678
attributes = {
36793679
LastSwiftUpdateCheck = 0920;
3680-
LastUpgradeCheck = 0930;
3680+
LastUpgradeCheck = 0940;
36813681
ORGANIZATIONNAME = Rocket.Chat;
36823682
TargetAttributes = {
36833683
41DF76DE1D2C50710028DBF8 = {
@@ -3761,10 +3761,9 @@
37613761
isa = PBXResourcesBuildPhase;
37623762
buildActionMask = 2147483647;
37633763
files = (
3764-
412A95D71FD94ED000954AA6 /* ChatMessageVideoView.xib in Resources */,
3764+
33A1BB0520FE312900AFA7D4 /* ChatMessageVideoView.xib in Resources */,
37653765
14F8A25D202E64B200175FDC /* BnW-29@3x.png in Resources */,
37663766
411D40CD20D28150001A1035 /* ChannelInfoBasicCell.xib in Resources */,
3767-
412A95D71FD94ED000954AA6 /* ChatMessageVideoView.xib in Resources */,
37683767
33A5C9CC206A565800FE1C8F /* regional.json in Resources */,
37693768
412EF3C62050507C001689A3 /* ReusableViewText.xib in Resources */,
37703769
14F8A224202E5CBF00175FDC /* Black-60@3x.png in Resources */,
@@ -4255,7 +4254,6 @@
42554254
4153E80520504BE700FBC26B /* ReusableViewText.swift in Sources */,
42564255
419ECCA61F3CA58A005F224B /* ChatControllerDocuments.swift in Sources */,
42574256
14BAFADE20308EE50054A2E6 /* DrawingBrushWidthViewController.swift in Sources */,
4258-
D10E9C201F6434A7007F1796 /* NSRangeExtensions.swift in Sources */,
42594257
807FB53D2044B49800E21429 /* Emojione+Transform.swift in Sources */,
42604258
7798B4191F852D670074B2F4 /* CustomField.swift in Sources */,
42614259
4156250820BEDCD100D20576 /* ServersListViewModel.swift in Sources */,
@@ -4528,6 +4526,7 @@
45284526
413FB6C11FE17D7D00F010AA /* UIViewExtentions.swift in Sources */,
45294527
8076FDB0204856AF00114F28 /* AuthCanBlockMessage.swift in Sources */,
45304528
8076FDA9204853DE00114F28 /* RealmExecute.swift in Sources */,
4529+
33A1BB0720FF75D600AFA7D4 /* BaseSubscriptionCell.swift in Sources */,
45314530
806EFA5E209BF1AC00D0D650 /* SubscriptionReadRequest.swift in Sources */,
45324531
9960C8302063F0C8004A034C /* WebBrowserTableViewController.swift in Sources */,
45334532
140A95E4202F536D003FD564 /* DrawingViewController.swift in Sources */,

Rocket.Chat.xcodeproj/xcshareddata/xcschemes/Rocket.Chat.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 = "0930"
3+
LastUpgradeVersion = "0940"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Rocket.Chat/API/API.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ final class API: APIFetcher {
7272
requestMiddlewares.append(VersionMiddleware(api: self))
7373
}
7474

75+
// swiftlint:disable function_body_length
7576
@discardableResult
7677
func fetch<R: APIRequest>(_ request: R, options: APIRequestOptionSet = [], sessionDelegate: URLSessionTaskDelegate? = nil,
7778
completion: ((_ result: APIResponse<R.APIResourceType>) -> Void)?) -> URLSessionTask? {

Rocket.Chat/API/Clients/MessagesClient.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import SwiftyJSON
1212
struct MessagesClient: APIClient {
1313
let api: AnyAPIFetcher
1414

15+
// swiftlint:disable function_body_length
1516
func sendMessage(_ message: Message, subscription: Subscription, realm: Realm? = Realm.current) {
1617
guard let id = message.identifier else { return }
1718
let subscriptionIdentifier = subscription.rid
@@ -80,6 +81,8 @@ struct MessagesClient: APIClient {
8081
}
8182
}
8283

84+
// swiftlint:enable function_body_length
85+
8386
func sendMessage(text: String, subscription: Subscription, id: String = String.random(18), user: User? = AuthManager.currentUser(), realm: Realm? = Realm.current) {
8487
let message = Message()
8588
message.internalType = ""
@@ -178,6 +181,7 @@ struct MessagesClient: APIClient {
178181
return true
179182
}
180183

184+
// swiftlint:disable function_body_length
181185
@discardableResult
182186
func reactMessage(_ message: Message, emoji: String, user: User? = AuthManager.currentUser(), realm: Realm? = Realm.current) -> Bool {
183187
guard let id = message.identifier, let username = user?.username else {
@@ -247,4 +251,6 @@ struct MessagesClient: APIClient {
247251

248252
return true
249253
}
254+
255+
// swiftlint:enable function_body_length
250256
}

Rocket.Chat/API/Clients/SpotlightClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct SpotlightClient: APIClient {
6969
}, completion: {
7070
completion(resource.raw, false)
7171
})
72-
case .error(let _):
72+
case .error:
7373
completion(nil, true)
7474
}
7575
}

Rocket.Chat/Controllers/Auth/ConnectServerViewController.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,20 @@ final class ConnectServerViewController: BaseViewController {
2323
var shouldAutoConnect = false
2424
var url: URL? {
2525
guard var urlText = textFieldServerURL.text else { return URL(string: defaultURL, scheme: "https") }
26+
2627
if urlText.isEmpty {
2728
urlText = defaultURL
2829
}
29-
return URL(string: urlText, scheme: "https")
30+
31+
// Remove all the whitespaces from the string
32+
urlText = urlText.removingWhitespaces()
33+
34+
// Add .rocket.chat in the end if it's only one string
35+
if !urlText.contains(".") {
36+
urlText += ".rocket.chat"
37+
}
38+
39+
return URL(string: urlText, scheme: "https")
3040
}
3141

3242
var serverPublicSettings: AuthSettings?

Rocket.Chat/Controllers/Auth/RegisterUsernameTableViewController.swift

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,21 @@ final class RegisterUsernameTableViewController: BaseTableViewController {
4444
}
4545

4646
func startLoading() {
47-
textFieldUsername.alpha = 0.5
48-
requesting = true
49-
view.layoutIfNeeded()
50-
registerButton.startLoading()
51-
textFieldUsername.resignFirstResponder()
47+
DispatchQueue.main.async {
48+
self.textFieldUsername.alpha = 0.5
49+
self.requesting = true
50+
self.view.layoutIfNeeded()
51+
self.registerButton.startLoading()
52+
self.textFieldUsername.resignFirstResponder()
53+
}
5254
}
5355

5456
func stopLoading() {
55-
textFieldUsername.alpha = 1
56-
requesting = false
57-
registerButton.stopLoading()
57+
DispatchQueue.main.async {
58+
self.textFieldUsername.alpha = 1
59+
self.requesting = false
60+
self.registerButton.stopLoading()
61+
}
5862
}
5963

6064
// MARK: Request username
@@ -83,7 +87,9 @@ final class RegisterUsernameTableViewController: BaseTableViewController {
8387
self?.stopLoading()
8488

8589
if !response.isError() {
86-
self?.textFieldUsername.text = response.result["result"].stringValue
90+
DispatchQueue.main.async {
91+
self?.textFieldUsername.text = response.result["result"].stringValue
92+
}
8793
}
8894
}
8995
}

Rocket.Chat/Controllers/Chat/ChannelActionsViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ extension ChannelActionsViewController {
144144
guard let subscription = self.subscription else { return }
145145

146146
SubscriptionManager.toggleFavorite(subscription) { [unowned self] (response) in
147-
if response.isError() {
148-
subscription.updateFavorite(!subscription.favorite)
149-
}
150-
151147
DispatchQueue.main.async {
148+
if response.isError() {
149+
subscription.updateFavorite(!subscription.favorite)
150+
}
151+
152152
self.updateButtonFavoriteImage()
153153
}
154154
}

Rocket.Chat/Controllers/Chat/ChatControllerMessageActions.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ extension ChatViewController {
3939
present(alert, animated: true, completion: nil)
4040
}
4141

42+
// swiftlint:disable function_body_length
4243
func actionsForMessage(_ message: Message, view: UIView) -> [UIAlertAction] {
4344
guard
4445
let messageUser = message.user,
@@ -124,6 +125,8 @@ extension ChatViewController {
124125
return actions
125126
}
126127

128+
// swiftlint:enable function_body_length
129+
127130
func actionsForFailedMessage(_ message: Message) -> [UIAlertAction] {
128131

129132
let resend = UIAlertAction(title: localized("chat.message.actions.resend"), style: .default, handler: { _ in

0 commit comments

Comments
 (0)