Add support for scheduled message sends.

This commit is contained in:
Clark
2023-01-26 10:37:08 -05:00
committed by Greyson Parrelli
parent df695f7611
commit f3e715e069
59 changed files with 1948 additions and 90 deletions

View File

@@ -50,6 +50,7 @@ data class OutgoingMessage(
val isEndSession: Boolean = false,
val isIdentityVerified: Boolean = false,
val isIdentityDefault: Boolean = false,
val scheduledDate: Long = -1,
) {
val isV2Group: Boolean = messageGroupContext != null && GroupV2UpdateMessageUtil.isGroupV2(messageGroupContext)
@@ -78,7 +79,8 @@ data class OutgoingMessage(
mismatches: Set<IdentityKeyMismatch> = emptySet(),
giftBadge: GiftBadge? = null,
isSecure: Boolean = false,
bodyRanges: BodyRangeList? = null
bodyRanges: BodyRangeList? = null,
scheduledDate: Long = -1
) : this(
recipient = recipient,
body = body ?: "",
@@ -99,7 +101,8 @@ data class OutgoingMessage(
identityKeyMismatches = mismatches,
giftBadge = giftBadge,
isSecure = isSecure,
bodyRanges = bodyRanges
bodyRanges = bodyRanges,
scheduledDate = scheduledDate
)
/**
@@ -153,6 +156,10 @@ data class OutgoingMessage(
return messageGroupContext!!.requireGroupV2Properties()
}
fun sendAt(scheduledDate: Long): OutgoingMessage {
return copy(scheduledDate = scheduledDate)
}
companion object {
/**