mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 01:08:33 +00:00
Do not set or read reaction target phone number.
This commit is contained in:
parent
e05f137bd8
commit
64efb3d2a4
@ -681,11 +681,6 @@ public class SignalServiceMessageSender {
|
||||
.setRemove(message.getReaction().get().isRemove())
|
||||
.setTargetSentTimestamp(message.getReaction().get().getTargetSentTimestamp());
|
||||
|
||||
// TODO [Alan] PhoneNumberPrivacy: Do not set this number
|
||||
if (message.getReaction().get().getTargetAuthor().getNumber().isPresent()) {
|
||||
reactionBuilder.setTargetAuthorE164(message.getReaction().get().getTargetAuthor().getNumber().get());
|
||||
}
|
||||
|
||||
if (message.getReaction().get().getTargetAuthor().getUuid().isPresent()) {
|
||||
reactionBuilder.setTargetAuthorUuid(message.getReaction().get().getTargetAuthor().getUuid().get().toString());
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.whispersystems.signalservice.internal.push.SignalServiceProtos.GroupContext.Type.DELIVER;
|
||||
|
||||
@ -747,17 +748,23 @@ public final class SignalServiceContent {
|
||||
private static SignalServiceDataMessage.Reaction createReaction(SignalServiceProtos.DataMessage content) {
|
||||
if (!content.hasReaction() ||
|
||||
!content.getReaction().hasEmoji() ||
|
||||
!(content.getReaction().hasTargetAuthorE164() || content.getReaction().hasTargetAuthorUuid()) ||
|
||||
!content.getReaction().hasTargetAuthorUuid() ||
|
||||
!content.getReaction().hasTargetSentTimestamp())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
SignalServiceProtos.DataMessage.Reaction reaction = content.getReaction();
|
||||
UUID uuid = UuidUtil.parseOrNull(reaction.getTargetAuthorUuid());
|
||||
|
||||
if (uuid == null) {
|
||||
Log.w(TAG, "Cannot parse author UUID on reaction");
|
||||
return null;
|
||||
}
|
||||
|
||||
return new SignalServiceDataMessage.Reaction(reaction.getEmoji(),
|
||||
reaction.getRemove(),
|
||||
new SignalServiceAddress(UuidUtil.parseOrNull(reaction.getTargetAuthorUuid()), reaction.getTargetAuthorE164()),
|
||||
new SignalServiceAddress(uuid, null),
|
||||
reaction.getTargetSentTimestamp());
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ message DataMessage {
|
||||
message Reaction {
|
||||
optional string emoji = 1;
|
||||
optional bool remove = 2;
|
||||
optional string targetAuthorE164 = 3;
|
||||
// optional string targetAuthorE164 = 3;
|
||||
optional string targetAuthorUuid = 4;
|
||||
optional uint64 targetSentTimestamp = 5;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user