refactor: swap device-id contexts for user-id contexts at call sites

Renames DecryptParams.ownDeviceId to ownUserId so decryptMessages actually
looks up bundles by user. Sweeps remaining OwnDeviceCtx and
loadDevicePrivateKey consumers in the desktop app to use cachedUserKey
from userIdentity. Files scheduled for deletion in later tasks
(BackupExportDialog, DeviceRestore, BackupRestoreDialog, BackupPromptBanner,
deviceBackup, DeviceRegistration) are left untouched.
This commit is contained in:
byGalax
2026-05-15 22:41:44 +02:00
parent 8d69329763
commit b89a7e2617
7 changed files with 57 additions and 65 deletions
+2 -2
View File
@@ -440,7 +440,7 @@ export async function removeReaction(
export interface DecryptParams {
client: AppSupabaseClient;
messages: MessageWithCipher[];
ownDeviceId: string;
ownUserId: string;
ownPrivateKey: Uint8Array;
/**
* Optional delegate that performs the symmetric-decrypt + utf-8 decode
@@ -483,7 +483,7 @@ export async function decryptMessages(opts: DecryptParams): Promise<DecryptedMes
const handle = await tryGetConvKey(
opts.client,
m.conversationId,
opts.ownDeviceId,
opts.ownUserId,
opts.ownPrivateKey,
m.keyVersion,
);