|
|
@ -255,20 +255,21 @@ class ThreadDisappearingMessagesViewModel: SessionTableViewModel<ThreadDisappear
|
|
|
|
|
|
|
|
|
|
|
|
guard self.config != updatedConfig else { return }
|
|
|
|
guard self.config != updatedConfig else { return }
|
|
|
|
|
|
|
|
|
|
|
|
// dependencies.storage.writeAsync { db in
|
|
|
|
dependencies.storage.writeAsync { db in
|
|
|
|
// guard let thread: SessionThread = try SessionThread.fetchOne(db, id: threadId) else {
|
|
|
|
guard let thread: SessionThread = try SessionThread.fetchOne(db, id: threadId) else {
|
|
|
|
// return
|
|
|
|
return
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//
|
|
|
|
|
|
|
|
// let config: DisappearingMessagesConfiguration = try DisappearingMessagesConfiguration
|
|
|
|
let config: DisappearingMessagesConfiguration = try DisappearingMessagesConfiguration
|
|
|
|
// .fetchOne(db, id: threadId)
|
|
|
|
.fetchOne(db, id: threadId)
|
|
|
|
// .defaulting(to: DisappearingMessagesConfiguration.defaultWith(threadId))
|
|
|
|
.defaulting(to: DisappearingMessagesConfiguration.defaultWith(threadId))
|
|
|
|
// .with(
|
|
|
|
.with(
|
|
|
|
// isEnabled: (currentSelection != 0),
|
|
|
|
isEnabled: updatedConfig.isEnabled,
|
|
|
|
// durationSeconds: currentSelection
|
|
|
|
durationSeconds: updatedConfig.durationSeconds,
|
|
|
|
// )
|
|
|
|
type: updatedConfig.type
|
|
|
|
// .saved(db)
|
|
|
|
)
|
|
|
|
//
|
|
|
|
.saved(db)
|
|
|
|
|
|
|
|
|
|
|
|
// let interaction: Interaction = try Interaction(
|
|
|
|
// let interaction: Interaction = try Interaction(
|
|
|
|
// threadId: threadId,
|
|
|
|
// threadId: threadId,
|
|
|
|
// authorId: getUserHexEncodedPublicKey(db),
|
|
|
|
// authorId: getUserHexEncodedPublicKey(db),
|
|
|
@ -287,6 +288,6 @@ class ThreadDisappearingMessagesViewModel: SessionTableViewModel<ThreadDisappear
|
|
|
|
// interactionId: interaction.id,
|
|
|
|
// interactionId: interaction.id,
|
|
|
|
// in: thread
|
|
|
|
// in: thread
|
|
|
|
// )
|
|
|
|
// )
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|