}
private IdentityKeyPair getIdentityKeyPair() {
- return account.getSignalProtocolStore().getIdentityKeyPair();
+ return account.getIdentityKeyPair();
}
public int getDeviceId() {
public void updateAccountAttributes() throws IOException {
accountManager.setAccountAttributes(null,
- account.getSignalProtocolStore().getLocalRegistrationId(),
+ account.getLocalRegistrationId(),
true,
// set legacy pin only if no KBS master key is set
account.getPinMasterKey() == null ? account.getRegistrationLockPin() : null,
var records = KeyUtils.generatePreKeyRecords(offset, ServiceConfig.PREKEY_BATCH_SIZE);
account.addPreKeys(records);
- account.save();
return records;
}
var record = KeyUtils.generateSignedPreKeyRecord(identityKeyPair, signedPreKeyId);
account.addSignedPreKey(record);
- account.save();
return record;
}
ServiceConfig.AUTOMATIC_NETWORK_RETRY);
}
- private SignalProfile getRecipientProfile(
+ public SignalProfile getRecipientProfile(
SignalServiceAddress address
) {
return getRecipientProfile(address, false);
return sendSelfMessage(messageBuilder);
}
+ public Pair<Long, List<SendMessageResult>> sendRemoteDeleteMessage(
+ long targetSentTimestamp, List<String> recipients
+ ) throws IOException, InvalidNumberException {
+ var delete = new SignalServiceDataMessage.RemoteDelete(targetSentTimestamp);
+ final var messageBuilder = SignalServiceDataMessage.newBuilder().withRemoteDelete(delete);
+ return sendMessage(messageBuilder, getSignalServiceAddresses(recipients));
+ }
+
+ public Pair<Long, List<SendMessageResult>> sendGroupRemoteDeleteMessage(
+ long targetSentTimestamp, GroupId groupId
+ ) throws IOException, NotAGroupMemberException, GroupNotFoundException {
+ var delete = new SignalServiceDataMessage.RemoteDelete(targetSentTimestamp);
+ final var messageBuilder = SignalServiceDataMessage.newBuilder().withRemoteDelete(delete);
+ return sendGroupMessage(messageBuilder, groupId);
+ }
+
public Pair<Long, List<SendMessageResult>> sendMessageReaction(
String emoji, boolean remove, String targetAuthor, long targetSentTimestamp, List<String> recipients
) throws IOException, InvalidNumberException {
}
private void handleEndSession(SignalServiceAddress source) {
- account.getSignalProtocolStore().deleteAllSessions(source);
+ account.getSessionStore().deleteAllSessions(source.getIdentifier());
}
private List<HandleAction> handleSignalServiceDataMessage(
if (profileEntry != null && profileEntry.getProfile() != null) {
return profileEntry.getProfile().getDisplayName();
}
-
return null;
}