Skip to content

Commit

Permalink
Drop reaction messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kenpowers-signal authored and scottnonnenberg-signal committed Dec 16, 2019
1 parent 2da39cc commit a83f5ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions js/models/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,13 @@
`Starting handleDataMessage for message ${message.idForLogging()} in conversation ${conversation.idForLogging()}`
);

// Drop reaction messages at this time
if (initialMessage.reaction) {
window.log.info('Dropping reaction message', this.idForLogging());
confirm();
return;
}

// First, check for duplicates. If we find one, stop processing here.
const existingMessage = await getMessageBySender(this.attributes, {
Message: Whisper.Message,
Expand Down
12 changes: 11 additions & 1 deletion protos/SignalService.proto
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,23 @@ message DataMessage {
optional AttachmentPointer data = 4;
}

message Reaction {
optional string emoji = 1;
optional bool remove = 2;
optional string targetAuthorE164 = 3;
optional string targetAuthorUuid = 4;
optional uint64 targetTimestamp = 5;
}

enum ProtocolVersion {
option allow_alias = true;

INITIAL = 0;
MESSAGE_TIMERS = 1;
VIEW_ONCE = 2;
VIEW_ONCE_VIDEO = 3;
CURRENT = 3;
REACTIONS = 4;
CURRENT = 4;
}

optional string body = 1;
Expand All @@ -192,6 +201,7 @@ message DataMessage {
optional Sticker sticker = 11;
optional uint32 requiredProtocolVersion = 12;
optional bool isViewOnce = 14;
optional Reaction reaction = 16;
}

message NullMessage {
Expand Down

0 comments on commit a83f5ce

Please sign in to comment.