mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Use toList() Stream method
This commit is contained in:
parent
f4346e3f0a
commit
dcde9fbe8e
1 changed files with 3 additions and 4 deletions
|
@ -51,7 +51,6 @@ import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class SendHelper {
|
public class SendHelper {
|
||||||
|
|
||||||
|
@ -275,7 +274,7 @@ public class SendHelper {
|
||||||
.getDevices()
|
.getDevices()
|
||||||
.stream()
|
.stream()
|
||||||
.map(device -> new SignalProtocolAddress(address.getIdentifier(), device))
|
.map(device -> new SignalProtocolAddress(address.getIdentifier(), device))
|
||||||
.collect(Collectors.toList());
|
.toList();
|
||||||
|
|
||||||
account.getSenderKeyStore().markSenderKeySharedWith(group.getDistributionId(), addresses);
|
account.getSenderKeyStore().markSenderKeySharedWith(group.getDistributionId(), addresses);
|
||||||
}
|
}
|
||||||
|
@ -536,14 +535,14 @@ public class SendHelper {
|
||||||
|
|
||||||
List<SignalServiceAddress> addresses = recipientIdList.stream()
|
List<SignalServiceAddress> addresses = recipientIdList.stream()
|
||||||
.map(context.getRecipientHelper()::resolveSignalServiceAddress)
|
.map(context.getRecipientHelper()::resolveSignalServiceAddress)
|
||||||
.collect(Collectors.toList());
|
.toList();
|
||||||
List<UnidentifiedAccess> unidentifiedAccesses = context.getUnidentifiedAccessHelper()
|
List<UnidentifiedAccess> unidentifiedAccesses = context.getUnidentifiedAccessHelper()
|
||||||
.getAccessFor(recipientIdList)
|
.getAccessFor(recipientIdList)
|
||||||
.stream()
|
.stream()
|
||||||
.map(Optional::get)
|
.map(Optional::get)
|
||||||
.map(UnidentifiedAccessPair::getTargetUnidentifiedAccess)
|
.map(UnidentifiedAccessPair::getTargetUnidentifiedAccess)
|
||||||
.map(Optional::get)
|
.map(Optional::get)
|
||||||
.collect(Collectors.toList());
|
.toList();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<SendMessageResult> results = sender.send(distributionId,
|
List<SendMessageResult> results = sender.send(distributionId,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue