mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-30 20:34:20 +01:00
Fix inspection issues
This commit is contained in:
@@ -150,10 +150,9 @@ class ProvisioningManagerImpl implements ProvisioningManager {
|
||||
|
||||
ManagerImpl m = null;
|
||||
try {
|
||||
final var accountPathFinal = accountPath;
|
||||
m = new ManagerImpl(account,
|
||||
pathConfig,
|
||||
new AccountFileUpdaterImpl(accountsStore, accountPathFinal),
|
||||
new AccountFileUpdaterImpl(accountsStore, accountPath),
|
||||
serviceEnvironmentConfig,
|
||||
userAgent);
|
||||
account = null;
|
||||
|
||||
@@ -15,7 +15,7 @@ public sealed interface RecipientIdentifier {
|
||||
|
||||
record NoteToSelf() implements RecipientIdentifier {
|
||||
|
||||
public static NoteToSelf INSTANCE = new NoteToSelf();
|
||||
public static final NoteToSelf INSTANCE = new NoteToSelf();
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
|
||||
@@ -47,7 +47,7 @@ public class UpdateGroup {
|
||||
}
|
||||
|
||||
public static Builder newBuilder(final UpdateGroup copy) {
|
||||
Builder builder = new Builder(copy.name,
|
||||
return new Builder(copy.name,
|
||||
copy.description,
|
||||
copy.members,
|
||||
copy.removeMembers,
|
||||
@@ -62,7 +62,6 @@ public class UpdateGroup {
|
||||
copy.avatarFile,
|
||||
copy.expirationTimer,
|
||||
copy.isAnnouncementGroup);
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static Builder newBuilder(
|
||||
|
||||
@@ -49,7 +49,8 @@ public class StickerHelper {
|
||||
|
||||
public void retrieveStickerPack(StickerPackId packId, byte[] packKey) throws InvalidMessageException, IOException {
|
||||
logger.debug("Retrieving sticker pack {}.", Hex.toStringCondensed(packId.serialize()));
|
||||
final var manifest = dependencies.getMessageReceiver().retrieveStickerManifest(packId.serialize(), packKey);
|
||||
final var messageReceiver = dependencies.getMessageReceiver();
|
||||
final var manifest = messageReceiver.retrieveStickerManifest(packId.serialize(), packKey);
|
||||
|
||||
final var stickerIds = new HashSet<Integer>();
|
||||
if (manifest.getCover().isPresent()) {
|
||||
@@ -60,8 +61,9 @@ public class StickerHelper {
|
||||
}
|
||||
|
||||
for (var id : stickerIds) {
|
||||
final var inputStream = dependencies.getMessageReceiver().retrieveSticker(packId.serialize(), packKey, id);
|
||||
context.getStickerPackStore().storeSticker(packId, id, o -> IOUtils.copyStream(inputStream, o));
|
||||
try (final var inputStream = messageReceiver.retrieveSticker(packId.serialize(), packKey, id)) {
|
||||
context.getStickerPackStore().storeSticker(packId, id, o -> IOUtils.copyStream(inputStream, o));
|
||||
}
|
||||
}
|
||||
|
||||
final var jsonManifest = new JsonStickerPack(manifest.getTitle().orElse(null),
|
||||
|
||||
@@ -186,7 +186,7 @@ public class IdentityKeyStore implements org.signal.libsignal.protocol.state.Ide
|
||||
}
|
||||
}
|
||||
|
||||
final Pattern identityFileNamePattern = Pattern.compile("([0-9]+)");
|
||||
final Pattern identityFileNamePattern = Pattern.compile("(\\d+)");
|
||||
|
||||
public List<IdentityInfo> getIdentities() {
|
||||
final var files = identitiesPath.listFiles();
|
||||
@@ -198,6 +198,7 @@ public class IdentityKeyStore implements org.signal.libsignal.protocol.state.Ide
|
||||
.map(f -> resolver.resolveRecipient(Long.parseLong(f.getName())))
|
||||
.filter(Objects::nonNull)
|
||||
.map(this::loadIdentityLocked)
|
||||
.filter(Objects::nonNull)
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class SignedPreKeyStore implements org.signal.libsignal.protocol.state.Si
|
||||
return loadSignedPreKeyRecord(file);
|
||||
}
|
||||
|
||||
final Pattern signedPreKeyFileNamePattern = Pattern.compile("([0-9]+)");
|
||||
final Pattern signedPreKeyFileNamePattern = Pattern.compile("(\\d+)");
|
||||
|
||||
@Override
|
||||
public List<SignedPreKeyRecord> loadSignedPreKeys() {
|
||||
|
||||
@@ -161,7 +161,7 @@ public class SenderKeyRecordStore implements org.signal.libsignal.protocol.group
|
||||
return parseFileNames(files);
|
||||
}
|
||||
|
||||
final Pattern senderKeyFileNamePattern = Pattern.compile("([0-9]+)_([0-9]+)_([0-9a-z\\-]+)");
|
||||
final Pattern senderKeyFileNamePattern = Pattern.compile("(\\d+)_(\\d+)_([\\da-z\\-]+)");
|
||||
|
||||
private List<Key> parseFileNames(final File[] files) {
|
||||
return Arrays.stream(files)
|
||||
|
||||
@@ -242,7 +242,7 @@ public class SessionStore implements SignalServiceSessionStore {
|
||||
return parseFileNames(files);
|
||||
}
|
||||
|
||||
final Pattern sessionFileNamePattern = Pattern.compile("([0-9]+)_([0-9]+)");
|
||||
final Pattern sessionFileNamePattern = Pattern.compile("(\\d+)_(\\d+)");
|
||||
|
||||
private List<Key> parseFileNames(final File[] files) {
|
||||
return Arrays.stream(files)
|
||||
|
||||
Reference in New Issue
Block a user