Turasa / libsignal-service-java

GNU General Public License v3.0
39 stars 22 forks source link

how to prevent duplicate sync messages when sending to groups with mixed sender key and legacy targets? #30

Closed thefinn93 closed 2 years ago

thefinn93 commented 2 years ago

It seems as though signal-cli has figured this out, but alas I cannot. I call messageSender.sendGroupDataMessage() to send to sender key supporting targets, then messageSender.sendDataMessage() for those that don't support sender keys. It sends the message to all recipients, but the primary device on my account shows that I sent the message twice. How do I avoid this?

Many thanks for your work on this project

AsamK commented 2 years ago

Hi, that behavior is controlled by the isRecipientUpdate flag for the sendDataMessage. If it is true, no additional sync message will be sent.

This should be the relevant line in signal-cli: https://github.com/AsamK/signal-cli/blob/bb3b9692e3620863017be9a1c06dd3652d59ce1c/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java#L434

thefinn93 commented 2 years ago

Thanks, that worked!