Allow long text to be sent via notification replies.

This commit is contained in:
Cody Henthorne
2025-04-09 09:11:04 -04:00
committed by Michelle Tang
parent 5bce2884a7
commit acbab9e736
2 changed files with 38 additions and 36 deletions

View File

@@ -15,6 +15,7 @@ import org.thoughtcrime.securesms.database.model.databaseprotos.MessageExtras
import org.thoughtcrime.securesms.linkpreview.LinkPreview
import org.thoughtcrime.securesms.recipients.Recipient
import org.thoughtcrime.securesms.sms.GroupV2UpdateMessageUtil
import kotlin.time.Duration.Companion.seconds
/**
* Represents all the data needed for an outgoing message.
@@ -469,6 +470,24 @@ data class OutgoingMessage(
)
}
@JvmStatic
fun quickReply(
threadRecipient: Recipient,
slideDeck: SlideDeck?,
body: String,
parentStoryId: ParentStoryId?
): OutgoingMessage {
return OutgoingMessage(
threadRecipient = threadRecipient,
sentTimeMillis = System.currentTimeMillis(),
expiresIn = threadRecipient.expiresInSeconds.seconds.inWholeMilliseconds,
attachments = slideDeck?.asAttachments() ?: emptyList(),
body = body,
parentStoryId = parentStoryId,
isSecure = true
)
}
@JvmStatic
fun buildMessage(slideDeck: SlideDeck, message: String): String {
return if (message.isNotEmpty() && slideDeck.body.isNotEmpty()) {