mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Swapped the Config message 'filter' to a 'compactMap' because apparently that doesn't crash
This commit is contained in:
parent
e4def22472
commit
3663e63bc7
1 changed files with 6 additions and 5 deletions
|
@ -52,10 +52,10 @@ extension ConfigurationMessage {
|
||||||
let currentUserPublicKey: String = getUserHexEncodedPublicKey()
|
let currentUserPublicKey: String = getUserHexEncodedPublicKey()
|
||||||
|
|
||||||
contacts = storage.getAllContacts(with: transaction)
|
contacts = storage.getAllContacts(with: transaction)
|
||||||
.filter { contact -> Bool in
|
.compactMap { contact -> ConfigurationMessage.Contact? in
|
||||||
let threadID = TSContactThread.threadID(fromContactSessionID: contact.sessionID)
|
let threadID = TSContactThread.threadID(fromContactSessionID: contact.sessionID)
|
||||||
|
|
||||||
return (
|
guard
|
||||||
// Skip the current user
|
// Skip the current user
|
||||||
contact.sessionID != currentUserPublicKey &&
|
contact.sessionID != currentUserPublicKey &&
|
||||||
// Contacts which have visible threads
|
// Contacts which have visible threads
|
||||||
|
@ -68,9 +68,10 @@ extension ConfigurationMessage {
|
||||||
// Sync blocked contacts
|
// Sync blocked contacts
|
||||||
SSKEnvironment.shared.blockingManager.isRecipientIdBlocked(contact.sessionID)
|
SSKEnvironment.shared.blockingManager.isRecipientIdBlocked(contact.sessionID)
|
||||||
)
|
)
|
||||||
)
|
else {
|
||||||
}
|
return nil
|
||||||
.map { contact -> ConfigurationMessage.Contact in
|
}
|
||||||
|
|
||||||
// Can just default the 'hasX' values to true as they will be set to this
|
// Can just default the 'hasX' values to true as they will be set to this
|
||||||
// when converting to proto anyway
|
// when converting to proto anyway
|
||||||
let profilePictureURL = contact.profilePictureURL
|
let profilePictureURL = contact.profilePictureURL
|
||||||
|
|
Loading…
Reference in a new issue