Fix issue where forwarded messages would show unlock icon.

This commit is contained in:
Alex Hart
2021-08-18 11:37:38 -03:00
committed by Greyson Parrelli
parent fec4a7692d
commit 7bede7e98a
6 changed files with 62 additions and 23 deletions

View File

@@ -78,23 +78,6 @@ public class OutgoingMediaMessage {
contacts, linkPreviews, mentions, new LinkedList<>(), new LinkedList<>());
}
public OutgoingMediaMessage(OutgoingMediaMessage that, long expiresIn) {
this(that.getRecipient(),
that.body,
that.attachments,
that.sentTimeMillis,
that.subscriptionId,
expiresIn,
that.viewOnce,
that.distributionType,
that.outgoingQuote,
that.contacts,
that.linkPreviews,
that.mentions,
that.networkFailures,
that.identityKeyMismatches);
}
public OutgoingMediaMessage(OutgoingMediaMessage that) {
this.recipient = that.getRecipient();
this.body = that.body;
@@ -113,6 +96,25 @@ public class OutgoingMediaMessage {
this.mentions.addAll(that.mentions);
}
public @NonNull OutgoingMediaMessage withExpiry(long expiresIn) {
return new OutgoingMediaMessage(
getRecipient(),
body,
attachments,
sentTimeMillis,
subscriptionId,
expiresIn,
viewOnce,
distributionType,
outgoingQuote,
contacts,
linkPreviews,
mentions,
networkFailures,
identityKeyMismatches
);
}
public Recipient getRecipient() {
return recipient;
}

View File

@@ -36,4 +36,19 @@ public class OutgoingSecureMediaMessage extends OutgoingMediaMessage {
public boolean isSecure() {
return true;
}
@Override
public @NonNull OutgoingMediaMessage withExpiry(long expiresIn) {
return new OutgoingSecureMediaMessage(getRecipient(),
getBody(),
getAttachments(),
getSentTimeMillis(),
getDistributionType(),
getExpiresIn(),
isViewOnce(),
getOutgoingQuote(),
getSharedContacts(),
getLinkPreviews(),
getMentions());
}
}