Revert "Do not set or read quote author phone number."

This reverts commit 936e772ba0.
This commit is contained in:
Alan Evans 2020-11-05 18:56:11 -04:00
parent 0ed1f73990
commit 872f935fd5
3 changed files with 9 additions and 4 deletions

View file

@ -584,6 +584,11 @@ public class SignalServiceMessageSender {
quoteBuilder.setAuthorUuid(message.getQuote().get().getAuthor().getUuid().get().toString());
}
// TODO [Alan] PhoneNumberPrivacy: Do not set this number
if (message.getQuote().get().getAuthor().getNumber().isPresent()) {
quoteBuilder.setAuthorE164(message.getQuote().get().getAuthor().getNumber().get());
}
if (!message.getQuote().get().getMentions().isEmpty()) {
for (SignalServiceDataMessage.Mention mention : message.getQuote().get().getMentions()) {
quoteBuilder.addBodyRanges(DataMessage.BodyRange.newBuilder()

View file

@ -660,8 +660,8 @@ public final class SignalServiceContent {
attachment.hasThumbnail() ? createAttachmentPointer(attachment.getThumbnail()) : null));
}
if (SignalServiceAddress.isValidAddress(content.getQuote().getAuthorUuid(), null)) {
SignalServiceAddress address = new SignalServiceAddress(UuidUtil.parseOrNull(content.getQuote().getAuthorUuid()), null);
if (SignalServiceAddress.isValidAddress(content.getQuote().getAuthorUuid(), content.getQuote().getAuthorE164())) {
SignalServiceAddress address = new SignalServiceAddress(UuidUtil.parseOrNull(content.getQuote().getAuthorUuid()), content.getQuote().getAuthorE164());
return new SignalServiceDataMessage.Quote(content.getQuote().getId(),
address,
@ -669,7 +669,7 @@ public final class SignalServiceContent {
attachments,
createMentions(content.getQuote().getBodyRangesList(), content.getQuote().getText(), isGroupV2));
} else {
Log.w(TAG, "Quote was missing author's UUID! Returning null.");
Log.w(TAG, "Quote was missing an author! Returning null.");
return null;
}
}

View file

@ -128,7 +128,7 @@ message DataMessage {
}
optional uint64 id = 1;
// optional string authorE164 = 2;
optional string authorE164 = 2;
optional string authorUuid = 5;
optional string text = 3;
repeated QuotedAttachment attachments = 4;