diff --git a/src/channels/plugins/bluebubbles-actions.ts b/src/channels/plugins/bluebubbles-actions.ts index 651cdc827..625eba59f 100644 --- a/src/channels/plugins/bluebubbles-actions.ts +++ b/src/channels/plugins/bluebubbles-actions.ts @@ -20,10 +20,15 @@ export const BLUEBUBBLES_ACTIONS = { sendAttachment: { gate: "sendAttachment" }, } as const satisfies Partial>; +const BLUEBUBBLES_ACTION_SPECS = BLUEBUBBLES_ACTIONS as Record< + keyof typeof BLUEBUBBLES_ACTIONS, + BlueBubblesActionSpec +>; + export const BLUEBUBBLES_ACTION_NAMES = Object.keys( BLUEBUBBLES_ACTIONS, -) as ChannelMessageActionName[]; +) as (keyof typeof BLUEBUBBLES_ACTIONS)[]; export const BLUEBUBBLES_GROUP_ACTIONS = new Set( - BLUEBUBBLES_ACTION_NAMES.filter((action) => BLUEBUBBLES_ACTIONS[action]?.groupOnly), + BLUEBUBBLES_ACTION_NAMES.filter((action) => BLUEBUBBLES_ACTION_SPECS[action]?.groupOnly), ); diff --git a/ui/src/ui/device-identity.ts b/ui/src/ui/device-identity.ts index 718816030..998975492 100644 --- a/ui/src/ui/device-identity.ts +++ b/ui/src/ui/device-identity.ts @@ -1,4 +1,4 @@ -import { ed25519 } from "@noble/ed25519"; +import * as ed25519 from "@noble/ed25519"; type StoredIdentity = { version: 1; @@ -43,8 +43,8 @@ async function fingerprintPublicKey(publicKey: Uint8Array): Promise { } async function generateIdentity(): Promise { - const privateKey = ed25519.utils.randomPrivateKey(); - const publicKey = await ed25519.getPublicKey(privateKey); + const privateKey = ed25519.utils.randomSecretKey(); + const publicKey = await ed25519.getPublicKeyAsync(privateKey); const deviceId = await fingerprintPublicKey(publicKey); return { deviceId, @@ -103,6 +103,6 @@ export async function loadOrCreateDeviceIdentity(): Promise { export async function signDevicePayload(privateKeyBase64Url: string, payload: string) { const key = base64UrlDecode(privateKeyBase64Url); const data = new TextEncoder().encode(payload); - const sig = await ed25519.sign(data, key); + const sig = await ed25519.signAsync(data, key); return base64UrlEncode(sig); }