mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Always include profile key in direct messages
Adjusts behavior to official client Fixes #416
This commit is contained in:
parent
9bba7a85ab
commit
9bb935b11f
1 changed files with 4 additions and 8 deletions
|
@ -1342,16 +1342,12 @@ public class Manager implements Closeable {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Send to all individually, so sync messages are sent correctly
|
// Send to all individually, so sync messages are sent correctly
|
||||||
|
messageBuilder.withProfileKey(account.getProfileKey().serialize());
|
||||||
List<SendMessageResult> results = new ArrayList<>(recipients.size());
|
List<SendMessageResult> results = new ArrayList<>(recipients.size());
|
||||||
for (SignalServiceAddress address : recipients) {
|
for (SignalServiceAddress address : recipients) {
|
||||||
ContactInfo contact = account.getContactStore().getContact(address);
|
final ContactInfo contact = account.getContactStore().getContact(address);
|
||||||
if (contact != null) {
|
final int expirationTime = contact != null ? contact.messageExpirationTime : 0;
|
||||||
messageBuilder.withExpiration(contact.messageExpirationTime);
|
messageBuilder.withExpiration(expirationTime);
|
||||||
messageBuilder.withProfileKey(account.getProfileKey().serialize());
|
|
||||||
} else {
|
|
||||||
messageBuilder.withExpiration(0);
|
|
||||||
messageBuilder.withProfileKey(null);
|
|
||||||
}
|
|
||||||
message = messageBuilder.build();
|
message = messageBuilder.build();
|
||||||
if (address.matches(account.getSelfAddress())) {
|
if (address.matches(account.getSelfAddress())) {
|
||||||
results.add(sendSelfMessage(message));
|
results.add(sendSelfMessage(message));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue