Fix delivery receipts

This commit is contained in:
nielsandriesse
2020-08-19 13:39:02 +10:00
parent e87fbe479a
commit c35c08340d
3 changed files with 12 additions and 9 deletions

View File

@@ -79,8 +79,12 @@ object SessionMetaProtocol {
}
@JvmStatic
fun shouldSendDeliveryReceipt(address: Address): Boolean {
return !address.isGroup
fun shouldSendDeliveryReceipt(message: SignalServiceDataMessage, address: Address): Boolean {
if (address.isGroup) { return false }
val hasBody = message.body.isPresent && message.body.get().isNotEmpty()
val hasAttachment = message.attachments.isPresent && message.attachments.get().isNotEmpty()
val hasLinkPreview = message.previews.isPresent && message.previews.get().isNotEmpty()
return hasBody || hasAttachment || hasLinkPreview
}
/**