Refactor Signal app routing

This commit is contained in:
Jamie Kyle 2023-11-02 12:42:31 -07:00 committed by GitHub
parent 86e6c2499c
commit 3ef0d221d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 1347 additions and 1044 deletions

View file

@ -9,11 +9,11 @@ import createDebug from 'debug';
import * as durations from '../../util/durations';
import { uuidToBytes } from '../../util/uuidToBytes';
import { generateUsernameLink } from '../../util/sgnlHref';
import { MY_STORY_ID } from '../../types/Stories';
import { Bootstrap } from '../bootstrap';
import type { App } from '../bootstrap';
import { bufferToUuid } from '../helpers';
import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes';
export const debug = createDebug('mock:test:username');
@ -310,9 +310,14 @@ describe('pnp/username', function (this: Mocha.Suite) {
CARL_USERNAME
);
const linkUrl = generateUsernameLink(
Buffer.concat([entropy, uuidToBytes(serverId)]).toString('base64')
);
const linkUrl = contactByEncryptedUsernameRoute
.toWebUrl({
encryptedUsername: Buffer.concat([
entropy,
uuidToBytes(serverId),
]).toString('base64'),
})
.toString();
debug('sending link to Note to Self');
await phone.sendText(desktop, linkUrl, {