this.serviceEnvironmentConfig = serviceEnvironmentConfig;
final var credentialsProvider = new DynamicCredentialsProvider(account.getAci(),
- account.getUsername(),
+ account.getAccount(),
account.getPassword(),
account.getDeviceId());
final var sessionLock = new SignalSessionLock() {
@Override
public String getSelfNumber() {
- return account.getUsername();
+ return account.getAccount();
}
@Override
public Map<String, Pair<String, UUID>> areUsersRegistered(Set<String> numbers) throws IOException {
Map<String, String> canonicalizedNumbers = numbers.stream().collect(Collectors.toMap(n -> n, n -> {
try {
- return PhoneNumberFormatter.formatNumber(n, account.getUsername());
+ return PhoneNumberFormatter.formatNumber(n, account.getAccount());
} catch (InvalidNumberException e) {
return "";
}
if (attachments != null) {
messageBuilder.withAttachments(attachmentHelper.uploadAttachments(attachments));
}
+ if (message.mentions().size() > 0) {
+ final var mentions = new ArrayList<SignalServiceDataMessage.Mention>();
+ for (final var m : message.mentions()) {
+ final var recipientId = resolveRecipient(m.recipient());
+ mentions.add(new SignalServiceDataMessage.Mention(resolveSignalServiceAddress(recipientId).getAci(),
+ m.start(),
+ m.length()));
+ }
+ messageBuilder.withMentions(mentions);
+ }
}
@Override
while (!Thread.interrupted()) {
SignalServiceEnvelope envelope;
final CachedMessage[] cachedMessage = {null};
- account.setLastReceiveTimestamp(System.currentTimeMillis());
+ final var nowMillis = System.currentTimeMillis();
+ if (nowMillis - account.getLastReceiveTimestamp() > 60000) {
+ account.setLastReceiveTimestamp(nowMillis);
+ }
logger.debug("Checking for new message from server");
try {
var result = signalWebSocket.readOrEmpty(unit.toMillis(timeout), envelope1 -> {
/**
* Trust this the identity with this fingerprint
*
- * @param recipient username of the identity
+ * @param recipient account of the identity
* @param fingerprint Fingerprint
*/
@Override
/**
* Trust this the identity with this safety number
*
- * @param recipient username of the identity
+ * @param recipient account of the identity
* @param safetyNumber Safety number
*/
@Override
/**
* Trust this the identity with this scannable safety number
*
- * @param recipient username of the identity
+ * @param recipient account of the identity
* @param safetyNumber Scannable safety number
*/
@Override
/**
* Trust all keys of this identity without verification
*
- * @param recipient username of the identity
+ * @param recipient account of the identity
*/
@Override
public boolean trustIdentityAllKeys(RecipientIdentifier.Single recipient) {