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

Commit 066dfba

Browse files
authored
Merge pull request #2621 from RocketChat/develop
[CHORE] Merge DEVELOP into BETA
2 parents 42fda31 + ac1a172 commit 066dfba

16 files changed

Lines changed: 174 additions & 143 deletions

File tree

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ CHECKOUT OPTIONS:
157157
:commit: c34d9ccef689c55b9eae69f3c65283da8d8b0c6c
158158
:git: https://github.com/RocketChat/RCMarkdownParser.git
159159
RocketChatViewController:
160-
:commit: 93164faa2437e9a24dfbc4bc603cff2268e87a0b
160+
:commit: ff8b2f080e05e10286f1d84304f0713375c3f952
161161
:git: https://github.com/RocketChat/RocketChatViewController
162162
SimpleImageViewer:
163163
:commit: 8222c338de0f285ca0c2d556c5d8dedd4a365b52

Pods/Manifest.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/RocketChatViewController/Composer/Classes/Library/AudioRecorder.swift

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/RocketChatViewController/Composer/Classes/Overlays/PreviewAudioView.swift

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/RocketChatViewController/Composer/Classes/Overlays/RecordAudioView.swift

Lines changed: 8 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rocket.Chat.ShareExtension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>3.4.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>245</string>
22+
<string>247</string>
2323
<key>ITSEncryptionExportComplianceCode</key>
2424
<string></string>
2525
<key>NSExtension</key>

Rocket.Chat/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
</dict>
223223
</array>
224224
<key>CFBundleVersion</key>
225-
<string>245</string>
225+
<string>247</string>
226226
<key>Fabric</key>
227227
<dict>
228228
<key>APIKey</key>

Rocket.Chat/Models/Mapping/SubscriptionModelMapping.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,18 @@ extension Subscription: ModelMappeable {
135135
}
136136

137137
if values["lastMessage"].dictionary != nil {
138-
let user = User()
139-
user.map(values["lastMessage"]["u"], realm: realm)
140-
realm?.add(user, update: true)
138+
if let userIdentifier = values["lastMessage"]["u"]["_id"].string {
139+
if let realm = realm {
140+
if let user = realm.object(ofType: User.self, forPrimaryKey: userIdentifier as AnyObject) {
141+
user.map(values["u"], realm: realm)
142+
realm.add(user, update: true)
143+
} else {
144+
let user = User()
145+
user.map(values["u"], realm: realm)
146+
realm.add(user, update: true)
147+
}
148+
}
149+
}
141150

142151
let message = Message()
143152
message.map(values["lastMessage"], realm: realm)

Rocket.Chat/Models/Subscription/Subscription.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,14 @@ extension Subscription {
151151
guard
152152
let auth = auth ?? AuthManager.isAuthenticated(),
153153
let baseURL = auth.baseURL(),
154+
let userId = auth.userId,
155+
let token = auth.token,
154156
let encodedName = name.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed)
155157
else {
156158
return nil
157159
}
158160

159-
return URL(string: "\(baseURL)/avatar/%22\(encodedName)?format=jpeg")
161+
return URL(string: "\(baseURL)/avatar/%22\(encodedName)?format=jpeg&rc_uid=\(userId)&rc_token=\(token)")
160162
}
161163
}
162164

0 commit comments

Comments
 (0)