Update libsignal-service-java

This commit is contained in:
AsamK 2023-04-16 21:18:54 +02:00
parent d2251ccd14
commit 842f13b2fc
3 changed files with 41 additions and 25 deletions

View file

@ -345,29 +345,41 @@ public class SendHelper {
},
() -> false,
urgent);
final SenderKeySenderHandler senderKeySender = (distId, recipients, unidentifiedAccess, isRecipientUpdate) -> {
final var res = messageSender.sendGroupDataMessage(distId,
recipients,
unidentifiedAccess,
isRecipientUpdate,
contentHint,
message,
SignalServiceMessageSender.SenderKeyGroupEvents.EMPTY,
urgent,
false);
synchronized (entryId) {
if (entryId.get() == -1) {
final var newId = messageSendLogStore.insertIfPossible(message.getTimestamp(),
res,
contentHint,
urgent);
entryId.set(newId);
} else {
messageSendLogStore.addRecipientToExistingEntryIfPossible(entryId.get(), res);
}
}
return res;
};
final SenderKeySenderHandler senderKeySender = (distId, recipients, unidentifiedAccess, isRecipientUpdate) -> messageSender.sendGroupDataMessage(
distId,
recipients,
unidentifiedAccess,
isRecipientUpdate,
contentHint,
message,
SignalServiceMessageSender.SenderKeyGroupEvents.EMPTY,
urgent,
false,
sendResult -> {
logger.trace("Partial message send results: {}", sendResult.size());
synchronized (entryId) {
if (entryId.get() == -1) {
final var newId = messageSendLogStore.insertIfPossible(message.getTimestamp(),
sendResult,
contentHint,
urgent);
entryId.set(newId);
} else {
messageSendLogStore.addRecipientToExistingEntryIfPossible(entryId.get(), sendResult);
}
}
synchronized (entryId) {
if (entryId.get() == -1) {
final var newId = messageSendLogStore.insertIfPossible(message.getTimestamp(),
sendResult,
contentHint,
urgent);
entryId.set(newId);
} else {
messageSendLogStore.addRecipientToExistingEntryIfPossible(entryId.get(), sendResult);
}
}
});
final var results = sendGroupMessageInternal(legacySender, senderKeySender, recipientIds, distributionId);
for (var r : results) {