remove useless expiration flag in data message

This commit is contained in:
Ryan Zhao 2022-03-01 17:15:38 +11:00
parent da66b1af2c
commit 1609812e5b

View file

@ -103,14 +103,6 @@ public final class VisibleMessage : Message {
// TODO: Contact
// Open group invitation
if let openGroupInvitation = openGroupInvitation, let openGroupInvitationProto = openGroupInvitation.toProto() { dataMessage.setOpenGroupInvitation(openGroupInvitationProto) }
// Expiration timer
// TODO: We * want * expiration timer updates to be explicit. But currently Android will disable the expiration timer for a conversation
// if it receives a message without the current expiration timer value attached to it...
var expiration: UInt32 = 0
if let disappearingMessagesConfiguration = OWSDisappearingMessagesConfiguration.fetch(uniqueId: threadID!, transaction: transaction) {
expiration = disappearingMessagesConfiguration.isEnabled ? disappearingMessagesConfiguration.durationSeconds : 0
}
dataMessage.setExpireTimer(expiration)
// Group context
do {
try setGroupContextIfNeeded(on: dataMessage, using: transaction)