Skip to content

Commit

Permalink
Prevent empty or all-whitespace string from being sent as a gift mess…
Browse files Browse the repository at this point in the history
…age.
  • Loading branch information
alex-signal committed Nov 28, 2022
1 parent ec1f771 commit d7404cf
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -75,12 +75,13 @@ class GiftSendJob private constructor(parameters: Parameters, private val recipi
return if (didInsert) {
Log.i(TAG, "Successfully inserted outbox message for gift", true)

if (additionalMessage != null) {
val trimmedMessage = additionalMessage?.trim()
if (!trimmedMessage.isNullOrBlank()) {
Log.i(TAG, "Sending additional message...")

val result = MultiShareSender.sendSync(
MultiShareArgs.Builder(setOf(ContactSearchKey.RecipientSearchKey.KnownRecipient(recipientId)))
.withDraftText(additionalMessage)
.withDraftText(trimmedMessage)
.build()
)

Expand Down

0 comments on commit d7404cf

Please sign in to comment.