Update libsignal-service-java

This commit is contained in:
AsamK 2023-12-10 18:57:05 +01:00
parent 74e5f386fb
commit 9823ad9070
5 changed files with 8 additions and 7 deletions

View file

@ -399,6 +399,7 @@ public class AccountHelper {
account.getAciIdentityKeyPair(),
account.getPniIdentityKeyPair(),
account.getProfileKey(),
account.getOrCreatePinMasterKey(),
verificationCode);
} catch (InvalidKeyException e) {
throw new InvalidDeviceLinkException("Invalid device link", e);

View file

@ -21,6 +21,7 @@ import org.whispersystems.signalservice.api.push.DistributionId;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.function.Supplier;
@ -140,7 +141,7 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
}
@Override
public Set<SignalProtocolAddress> getAllAddressesWithActiveSessions(final List<String> addressNames) {
public Map<SignalProtocolAddress, SessionRecord> getAllAddressesWithActiveSessions(final List<String> addressNames) {
return sessionStore.getAllAddressesWithActiveSessions(addressNames);
}

View file

@ -22,7 +22,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
public class SessionStore implements SignalServiceSessionStore {
@ -198,7 +197,7 @@ public class SessionStore implements SignalServiceSessionStore {
}
@Override
public Set<SignalProtocolAddress> getAllAddressesWithActiveSessions(final List<String> addressNames) {
public Map<SignalProtocolAddress, SessionRecord> getAllAddressesWithActiveSessions(final List<String> addressNames) {
final var serviceIdsCommaSeparated = addressNames.stream()
.map(address -> "'" + address.replaceAll("'", "''") + "'")
.collect(Collectors.joining(","));
@ -215,9 +214,8 @@ public class SessionStore implements SignalServiceSessionStore {
return Utils.executeQueryForStream(statement,
res -> new Pair<>(getKeyFromResultSet(res), getSessionRecordFromResultSet(res)))
.filter(pair -> isActive(pair.second()))
.map(Pair::first)
.map(key -> new SignalProtocolAddress(key.address(), key.deviceId()))
.collect(Collectors.toSet());
.collect(Collectors.toMap(pair -> new SignalProtocolAddress(pair.first().address(),
pair.first().deviceId()), Pair::second));
}
} catch (SQLException e) {
throw new RuntimeException("Failed read from session store", e);

View file

@ -49,6 +49,7 @@ public class AttachmentUtils {
false,
false,
false,
false,
preview,
0,
0,

View file

@ -16,7 +16,7 @@ dependencyResolutionManagement {
library("logback", "ch.qos.logback", "logback-classic").version("1.4.11")
library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_88")
library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_89")
library("sqlite", "org.xerial", "sqlite-jdbc").version("3.44.0.0")
library("hikari", "com.zaxxer", "HikariCP").version("5.1.0")
library("junit.jupiter", "org.junit.jupiter", "junit-jupiter").version("5.10.1")