Skip to content

Commit

Permalink
Revert "Do not set or read quote author phone number."
Browse files Browse the repository at this point in the history
This reverts commit 936e772.
  • Loading branch information
alan-signal committed Nov 5, 2020
1 parent 0ed1f73 commit 872f935
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,11 @@ private byte[] createMessageContent(SignalServiceDataMessage message) throws IOE
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,16 +660,16 @@ private static SignalServiceDataMessage.Quote createQuote(SignalServiceProtos.Da
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,
content.getQuote().getText(),
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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion libsignal/service/src/main/proto/SignalService.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 872f935

Please sign in to comment.