|
|
|
@ -21,7 +21,7 @@ public struct SessionThreadViewModel: FetchableRecordWithRowId, Decodable, Equat
|
|
|
|
|
public static let threadCreationDateTimestampKey: SQL = SQL(stringLiteral: CodingKeys.threadCreationDateTimestamp.stringValue)
|
|
|
|
|
public static let threadMemberNamesKey: SQL = SQL(stringLiteral: CodingKeys.threadMemberNames.stringValue)
|
|
|
|
|
public static let threadIsNoteToSelfKey: SQL = SQL(stringLiteral: CodingKeys.threadIsNoteToSelf.stringValue)
|
|
|
|
|
public static let contactIsUsingOutdatedClientKey: SQL = SQL(stringLiteral: CodingKeys.contactIsUsingOutdatedClient.stringValue)
|
|
|
|
|
public static let contactLastKnownClientVersionKey: SQL = SQL(stringLiteral: CodingKeys.contactLastKnownClientVersion.stringValue)
|
|
|
|
|
public static let threadIsMessageRequestKey: SQL = SQL(stringLiteral: CodingKeys.threadIsMessageRequest.stringValue)
|
|
|
|
|
public static let threadRequiresApprovalKey: SQL = SQL(stringLiteral: CodingKeys.threadRequiresApproval.stringValue)
|
|
|
|
|
public static let threadShouldBeVisibleKey: SQL = SQL(stringLiteral: CodingKeys.threadShouldBeVisible.stringValue)
|
|
|
|
@ -86,10 +86,7 @@ public struct SessionThreadViewModel: FetchableRecordWithRowId, Decodable, Equat
|
|
|
|
|
|
|
|
|
|
public let threadIsNoteToSelf: Bool
|
|
|
|
|
|
|
|
|
|
/// This flag indicated whether the contact in this thread is using an outdated client regarding
|
|
|
|
|
/// disappearing messages configuration. We can use this flag in the future for other features
|
|
|
|
|
/// as well.
|
|
|
|
|
public let contactIsUsingOutdatedClient: Bool
|
|
|
|
|
public let contactLastKnownClientVersion: SessionVersion.FeatureVersion?
|
|
|
|
|
|
|
|
|
|
/// This flag indicates whether the thread is an outgoing message request
|
|
|
|
|
public let threadIsMessageRequest: Bool?
|
|
|
|
@ -265,7 +262,7 @@ public extension SessionThreadViewModel {
|
|
|
|
|
self.threadMemberNames = nil
|
|
|
|
|
|
|
|
|
|
self.threadIsNoteToSelf = threadIsNoteToSelf
|
|
|
|
|
self.contactIsUsingOutdatedClient = false
|
|
|
|
|
self.contactLastKnownClientVersion = nil
|
|
|
|
|
self.threadIsMessageRequest = false
|
|
|
|
|
self.threadRequiresApproval = false
|
|
|
|
|
self.threadShouldBeVisible = false
|
|
|
|
@ -334,7 +331,7 @@ public extension SessionThreadViewModel {
|
|
|
|
|
threadCreationDateTimestamp: self.threadCreationDateTimestamp,
|
|
|
|
|
threadMemberNames: self.threadMemberNames,
|
|
|
|
|
threadIsNoteToSelf: self.threadIsNoteToSelf,
|
|
|
|
|
contactIsUsingOutdatedClient: self.contactIsUsingOutdatedClient,
|
|
|
|
|
contactLastKnownClientVersion: self.contactLastKnownClientVersion,
|
|
|
|
|
threadIsMessageRequest: self.threadIsMessageRequest,
|
|
|
|
|
threadRequiresApproval: self.threadRequiresApproval,
|
|
|
|
|
threadShouldBeVisible: self.threadShouldBeVisible,
|
|
|
|
@ -391,7 +388,7 @@ public extension SessionThreadViewModel {
|
|
|
|
|
threadCreationDateTimestamp: self.threadCreationDateTimestamp,
|
|
|
|
|
threadMemberNames: self.threadMemberNames,
|
|
|
|
|
threadIsNoteToSelf: self.threadIsNoteToSelf,
|
|
|
|
|
contactIsUsingOutdatedClient: self.contactIsUsingOutdatedClient,
|
|
|
|
|
contactLastKnownClientVersion: self.contactLastKnownClientVersion,
|
|
|
|
|
threadIsMessageRequest: self.threadIsMessageRequest,
|
|
|
|
|
threadRequiresApproval: self.threadRequiresApproval,
|
|
|
|
|
threadShouldBeVisible: self.threadShouldBeVisible,
|
|
|
|
@ -751,7 +748,7 @@ public extension SessionThreadViewModel {
|
|
|
|
|
/// parse and might throw
|
|
|
|
|
///
|
|
|
|
|
/// Explicitly set default values for the fields ignored for search results
|
|
|
|
|
let numColumnsBeforeProfiles: Int = 15
|
|
|
|
|
let numColumnsBeforeProfiles: Int = 16
|
|
|
|
|
let request: SQLRequest<ViewModel> = """
|
|
|
|
|
SELECT
|
|
|
|
|
\(thread.alias[Column.rowID]) AS \(ViewModel.rowIdKey),
|
|
|
|
@ -760,7 +757,7 @@ public extension SessionThreadViewModel {
|
|
|
|
|
\(thread[.creationDateTimestamp]) AS \(ViewModel.threadCreationDateTimestampKey),
|
|
|
|
|
|
|
|
|
|
(\(SQL("\(thread[.id]) = \(userPublicKey)"))) AS \(ViewModel.threadIsNoteToSelfKey),
|
|
|
|
|
\(contact[.isUsingOutdatedClient]) AS \(ViewModel.contactIsUsingOutdatedClientKey),
|
|
|
|
|
\(contact[.lastKnownClientVersion]) AS \(ViewModel.contactLastKnownClientVersionKey),
|
|
|
|
|
(
|
|
|
|
|
\(SQL("\(thread[.variant]) = \(SessionThread.Variant.contact)")) AND
|
|
|
|
|
\(SQL("\(thread[.id]) != \(userPublicKey)")) AND
|
|
|
|
|