Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ CHECKOUT OPTIONS:
:commit: c34d9ccef689c55b9eae69f3c65283da8d8b0c6c
:git: https://github.com/RocketChat/RCMarkdownParser.git
RocketChatViewController:
:commit: 93164faa2437e9a24dfbc4bc603cff2268e87a0b
:commit: ff8b2f080e05e10286f1d84304f0713375c3f952
:git: https://github.com/RocketChat/RocketChatViewController
SimpleImageViewer:
:commit: 8222c338de0f285ca0c2d556c5d8dedd4a365b52
Expand Down
2 changes: 1 addition & 1 deletion Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Rocket.Chat.ShareExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>3.4.0</string>
<key>CFBundleVersion</key>
<string>245</string>
<string>247</string>
<key>ITSEncryptionExportComplianceCode</key>
<string></string>
<key>NSExtension</key>
Expand Down
2 changes: 1 addition & 1 deletion Rocket.Chat/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>245</string>
<string>247</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
15 changes: 12 additions & 3 deletions Rocket.Chat/Models/Mapping/SubscriptionModelMapping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,18 @@ extension Subscription: ModelMappeable {
}

if values["lastMessage"].dictionary != nil {
let user = User()
user.map(values["lastMessage"]["u"], realm: realm)
realm?.add(user, update: true)
if let userIdentifier = values["lastMessage"]["u"]["_id"].string {
if let realm = realm {
if let user = realm.object(ofType: User.self, forPrimaryKey: userIdentifier as AnyObject) {
user.map(values["u"], realm: realm)
realm.add(user, update: true)
} else {
let user = User()
user.map(values["u"], realm: realm)
realm.add(user, update: true)
}
}
}

let message = Message()
message.map(values["lastMessage"], realm: realm)
Expand Down
4 changes: 3 additions & 1 deletion Rocket.Chat/Models/Subscription/Subscription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ extension Subscription {
guard
let auth = auth ?? AuthManager.isAuthenticated(),
let baseURL = auth.baseURL(),
let userId = auth.userId,
let token = auth.token,
let encodedName = name.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed)
else {
return nil
}

return URL(string: "\(baseURL)/avatar/%22\(encodedName)?format=jpeg")
return URL(string: "\(baseURL)/avatar/%22\(encodedName)?format=jpeg&rc_uid=\(userId)&rc_token=\(token)")
}
}

Expand Down
Loading