mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Remove GroupContext proto
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
@@ -32,10 +32,6 @@ const PROCESSED_ATTACHMENT: ProcessedAttachment = {
|
||||
size: 34,
|
||||
};
|
||||
|
||||
const GROUP_ID = new Uint8Array([0x68, 0x65, 0x79]);
|
||||
|
||||
const DERIVED_GROUPV2_ID = '7qQUi8Wa6Jm3Rl+l63saATGeciEqokbHpP+lV3F5t9o=';
|
||||
|
||||
describe('processDataMessage', () => {
|
||||
const check = (message: Proto.IDataMessage) =>
|
||||
processDataMessage(
|
||||
@@ -85,59 +81,6 @@ describe('processDataMessage', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should process group context UPDATE/QUIT message', () => {
|
||||
const { UPDATE, QUIT } = Proto.GroupContext.Type;
|
||||
|
||||
for (const type of [UPDATE, QUIT]) {
|
||||
const out = check({
|
||||
body: 'should be deleted',
|
||||
attachments: [UNPROCESSED_ATTACHMENT],
|
||||
group: {
|
||||
id: GROUP_ID,
|
||||
name: 'Group',
|
||||
avatar: UNPROCESSED_ATTACHMENT,
|
||||
type,
|
||||
membersE164: ['+1'],
|
||||
},
|
||||
});
|
||||
|
||||
assert.isUndefined(out.body);
|
||||
assert.strictEqual(out.attachments.length, 0);
|
||||
assert.deepStrictEqual(out.group, {
|
||||
id: 'hey',
|
||||
name: 'Group',
|
||||
avatar: PROCESSED_ATTACHMENT,
|
||||
type,
|
||||
membersE164: ['+1'],
|
||||
derivedGroupV2Id: DERIVED_GROUPV2_ID,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it('should process group context DELIVER message', () => {
|
||||
const out = check({
|
||||
body: 'should not be deleted',
|
||||
attachments: [UNPROCESSED_ATTACHMENT],
|
||||
group: {
|
||||
id: GROUP_ID,
|
||||
name: 'should be deleted',
|
||||
membersE164: ['should be deleted'],
|
||||
type: Proto.GroupContext.Type.DELIVER,
|
||||
},
|
||||
});
|
||||
|
||||
assert.strictEqual(out.body, 'should not be deleted');
|
||||
assert.strictEqual(out.attachments.length, 1);
|
||||
assert.deepStrictEqual(out.group, {
|
||||
id: 'hey',
|
||||
type: Proto.GroupContext.Type.DELIVER,
|
||||
membersE164: [],
|
||||
derivedGroupV2Id: DERIVED_GROUPV2_ID,
|
||||
avatar: undefined,
|
||||
name: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it('should process groupv2 context', () => {
|
||||
const out = check({
|
||||
groupV2: {
|
||||
@@ -312,15 +255,10 @@ describe('processDataMessage', () => {
|
||||
const out = check({
|
||||
flags: FLAGS.END_SESSION,
|
||||
body: 'should be deleted',
|
||||
group: {
|
||||
id: GROUP_ID,
|
||||
type: Proto.GroupContext.Type.DELIVER,
|
||||
},
|
||||
attachments: [UNPROCESSED_ATTACHMENT],
|
||||
});
|
||||
|
||||
assert.isUndefined(out.body);
|
||||
assert.isUndefined(out.group);
|
||||
assert.deepStrictEqual(out.attachments, []);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user