rename groupInvitation in proto and remove more stuff unused

pull/1692/head
Audric Ackermann 4 years ago
parent c090782919
commit 173b49723b
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -94,6 +94,10 @@ message DataMessage {
optional string profilePicture = 2;
}
message OpenGroupInvitation {
optional string url = 1;
optional string name = 3;
}
message ClosedGroupControlMessage {
@ -127,10 +131,6 @@ message DataMessage {
optional uint32 expireTimer = 8;
}
message GroupInvitation {
optional string serverAddress = 1;
optional string serverName = 3;
}
optional string body = 1;
repeated AttachmentPointer attachments = 2;
@ -140,10 +140,9 @@ message DataMessage {
optional bytes profileKey = 6;
optional uint64 timestamp = 7;
optional Quote quote = 8;
repeated Contact contact = 9;
repeated Preview preview = 10;
optional LokiProfile profile = 101;
optional GroupInvitation groupInvitation = 102;
optional OpenGroupInvitation openGroupInvitation = 102;
optional ClosedGroupControlMessage closedGroupControlMessage = 104;
optional string syncTarget = 105;
}
@ -226,39 +225,3 @@ message GroupContext {
repeated string admins = 6;
}
message ContactDetails {
message Avatar {
optional string contentType = 1;
optional uint32 length = 2;
}
// @required
optional string number = 1;
optional string name = 2;
optional Avatar avatar = 3;
optional string color = 4;
optional bytes profileKey = 6;
optional bool blocked = 7;
optional uint32 expireTimer = 8;
optional string nickname = 101;
}
message GroupDetails {
message Avatar {
optional string contentType = 1;
optional uint32 length = 2;
}
// @required
optional bytes id = 1;
optional string name = 2;
repeated string members = 3;
optional Avatar avatar = 4;
optional bool active = 5 [default = true];
optional uint32 expireTimer = 6;
optional string color = 7;
optional bool blocked = 8;
repeated string admins = 9;
}

@ -186,8 +186,6 @@ export async function handleNewClosedGroup(
await removeFromCache(envelope);
return;
}
// FIXME maybe we should handle an expiretimer here too? And on ClosedGroup updates?
const maybeConvo = ConversationController.getInstance().get(groupId);
const expireTimer = groupUpdate.expireTimer;

@ -297,10 +297,9 @@ function shouldDropBlockedUserMessage(content: SignalService.Content): boolean {
const data = content.dataMessage;
const isControlDataMessageOnly =
!data.body &&
!data.contact?.length &&
!data.preview?.length &&
!data.attachments?.length &&
!data.groupInvitation &&
!data.openGroupInvitation &&
!data.quote;
return !isControlDataMessageOnly;

@ -249,7 +249,7 @@ export async function processDecrypted(
}
export function isMessageEmpty(message: SignalService.DataMessage) {
const { flags, body, attachments, group, quote, contact, preview, groupInvitation } = message;
const { flags, body, attachments, group, quote, preview, openGroupInvitation } = message;
return (
!flags &&
@ -258,9 +258,8 @@ export function isMessageEmpty(message: SignalService.DataMessage) {
_.isEmpty(attachments) &&
_.isEmpty(group) &&
_.isEmpty(quote) &&
_.isEmpty(contact) &&
_.isEmpty(preview) &&
_.isEmpty(groupInvitation)
_.isEmpty(openGroupInvitation)
);
}

@ -24,13 +24,13 @@ export class GroupInvitationMessage extends DataMessage {
}
public dataProto(): SignalService.DataMessage {
const groupInvitation = new SignalService.DataMessage.GroupInvitation({
serverAddress: this.serverAddress,
serverName: this.serverName,
const openGroupInvitation = new SignalService.DataMessage.OpenGroupInvitation({
url: this.serverAddress,
name: this.serverName,
});
return new SignalService.DataMessage({
groupInvitation,
openGroupInvitation,
expireTimer: this.expireTimer,
});
}

@ -23,8 +23,8 @@ describe('GroupInvitationMessage', () => {
const plainText = message.plainTextBuffer();
const decoded = SignalService.Content.decode(plainText);
expect(decoded.dataMessage?.groupInvitation).to.have.property('serverAddress', serverAddress);
expect(decoded.dataMessage?.groupInvitation).to.have.property('serverName', serverName);
expect(decoded.dataMessage?.openGroupInvitation).to.have.property('url', serverAddress);
expect(decoded.dataMessage?.openGroupInvitation).to.have.property('name', serverName);
});
it('correct ttl', () => {

Loading…
Cancel
Save