Edit distribution lists via story settings menu

This commit is contained in:
Josh Perez 2022-07-20 20:07:09 -04:00 committed by GitHub
parent 9986d10947
commit e321e1fea8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 2403 additions and 102 deletions

View file

@ -9,6 +9,10 @@ import createDebug from 'debug';
import * as durations from '../../util/durations';
import { Bootstrap } from '../bootstrap';
import type { App } from '../bootstrap';
import { MY_STORIES_ID } from '../../types/Stories';
import { uuidToBytes } from '../../util/uuidToBytes';
const IdentifierType = Proto.ManifestRecord.Identifier.Type;
export const debug = createDebug('mock:test:gv2');
@ -58,6 +62,19 @@ describe('gv2', function needsName() {
givenName: 'PNI Contact',
});
state = state.addRecord({
type: IdentifierType.STORY_DISTRIBUTION_LIST,
record: {
storyDistributionList: {
allowsReplies: true,
identifier: uuidToBytes(MY_STORIES_ID),
isBlockList: true,
name: MY_STORIES_ID,
recipientUuids: [],
},
},
});
await phone.setStorageState(state);
app = await bootstrap.link();

View file

@ -7,6 +7,8 @@ import { StorageState, Proto } from '@signalapp/mock-server';
import { App } from '../playwright';
import { Bootstrap } from '../bootstrap';
import type { BootstrapOptions } from '../bootstrap';
import { MY_STORIES_ID } from '../../types/Stories';
import { uuidToBytes } from '../../util/uuidToBytes';
export const debug = createDebug('mock:test:storage');
@ -14,6 +16,8 @@ export { App, Bootstrap };
const GROUP_SIZE = 8;
const IdentifierType = Proto.ManifestRecord.Identifier.Type;
export type InitStorageResultType = Readonly<{
bootstrap: Bootstrap;
app: App;
@ -77,6 +81,19 @@ export async function initStorage(
state = state.pin(firstContact);
state = state.addRecord({
type: IdentifierType.STORY_DISTRIBUTION_LIST,
record: {
storyDistributionList: {
allowsReplies: true,
identifier: uuidToBytes(MY_STORIES_ID),
isBlockList: true,
name: MY_STORIES_ID,
recipientUuids: [],
},
},
});
await phone.setStorageState(state);
// Link new device