New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Medium groups with sender keys (essentials) #1117
Conversation
if (senderIdentity === ourNumber) { | ||
// Ignoring our own message | ||
return request.respond(200, 'OK'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some server calls, we reply only when the message is processed really. I think it's a timing security stuff. Shouldn't we do the same here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't actually do anything at the moment:
this.respond = (status, message) => {
// Mock websocket response
window.log.info(status, message);
};
|
||
return plaintext; | ||
}) | ||
.then(plaintext => this.postDecrypt(envelope, plaintext)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the envelope (first arg) set when calling postDecrypt after the case textsecure.protobuf.Envelope.Type.PREKEY_BUNDLE
or textsecure.protobuf.Envelope.Type.CIPHERTEXT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
envelope
is already set at the top of async decrypt(envelope, ciphertext)
right?
|
||
proto.mediumGroupUpdate = update; | ||
|
||
// TODO: send to our linked devices too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a linked device should receive this message too normally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I removed the comment already in the upcoming PR.
}; | ||
|
||
if (numbers.length === 0) { | ||
return Promise.resolve({ | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return of an object here and a promise just below
return this.sendMessage(attrs, options);
it's not causing any issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method is async
so every return is implicitly wrapped in a promise.
const attachment = await this.makeAttachmentPointer(avatar); | ||
|
||
proto.group.avatar = attachment; | ||
// TODO: re-enable this once we have attachments | ||
proto.group.avatar = null; | ||
await this.sendGroupProto(recipients, proto, Date.now(), options); | ||
|
||
return proto.group.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you just don't like the .then
syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. For one, it makes it hard to see what is being returned.
@@ -12,6 +12,7 @@ message Envelope { | |||
PREKEY_BUNDLE = 3; //Used By Signal. DO NOT TOUCH! we don't use this at all. | |||
RECEIPT = 5; | |||
UNIDENTIFIED_SENDER = 6; | |||
MEDIUM_GROUP_CIPHERTEXT = 7; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding was that we added stuff of our own after 100 in the case we have to pull some stuff from signal. MEDIUM_GROUP_CIPHERTEXT
is considered a signal stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deliberately chose not to use 100+ values, because I don't think we should compromise our codebase because of Signal. If Signal ever adds a new entry for 7 (and we ever pull changes), we'll just give it the next available value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
This is not a complete implementation, but most of it is done and this PR is getting big.
Implemented:
For testing:
Example:
Still missing: