|
|
|
@ -479,11 +479,21 @@ class ThreadDisappearingMessagesSettingsViewModel: SessionTableViewModel, Naviga
|
|
|
|
|
let userPublicKey: String = getUserHexEncodedPublicKey(db, using: dependencies)
|
|
|
|
|
|
|
|
|
|
if Features.useNewDisappearingMessagesConfig {
|
|
|
|
|
_ = try Interaction
|
|
|
|
|
.filter(Interaction.Columns.threadId == threadId)
|
|
|
|
|
.filter(Interaction.Columns.variant == Interaction.Variant.infoDisappearingMessagesUpdate)
|
|
|
|
|
.filter(Interaction.Columns.authorId == userPublicKey) // FIXME: Remove all in legacy groups
|
|
|
|
|
.deleteAll(db)
|
|
|
|
|
switch threadVariant {
|
|
|
|
|
case .contact:
|
|
|
|
|
_ = try Interaction
|
|
|
|
|
.filter(Interaction.Columns.threadId == threadId)
|
|
|
|
|
.filter(Interaction.Columns.variant == Interaction.Variant.infoDisappearingMessagesUpdate)
|
|
|
|
|
.filter(Interaction.Columns.authorId == userPublicKey)
|
|
|
|
|
.deleteAll(db)
|
|
|
|
|
case .legacyGroup:
|
|
|
|
|
_ = try Interaction
|
|
|
|
|
.filter(Interaction.Columns.threadId == threadId)
|
|
|
|
|
.filter(Interaction.Columns.variant == Interaction.Variant.infoDisappearingMessagesUpdate)
|
|
|
|
|
.deleteAll(db)
|
|
|
|
|
default:
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let currentTimestampMs: Int64 = SnodeAPI.currentOffsetTimestampMs()
|
|
|
|
|