Prevent empty or all-whitespace string from being sent as a gift message.
This commit is contained in:
parent
ec1f771364
commit
d7404cf32f
1 changed files with 3 additions and 2 deletions
|
@ -75,12 +75,13 @@ class GiftSendJob private constructor(parameters: Parameters, private val recipi
|
||||||
return if (didInsert) {
|
return if (didInsert) {
|
||||||
Log.i(TAG, "Successfully inserted outbox message for gift", true)
|
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...")
|
Log.i(TAG, "Sending additional message...")
|
||||||
|
|
||||||
val result = MultiShareSender.sendSync(
|
val result = MultiShareSender.sendSync(
|
||||||
MultiShareArgs.Builder(setOf(ContactSearchKey.RecipientSearchKey.KnownRecipient(recipientId)))
|
MultiShareArgs.Builder(setOf(ContactSearchKey.RecipientSearchKey.KnownRecipient(recipientId)))
|
||||||
.withDraftText(additionalMessage)
|
.withDraftText(trimmedMessage)
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue