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:
@@ -1,4 +1,3 @@
|
||||
import { loadDevicePrivateKey } from '@chat-app/shared/auth';
|
||||
import { sendEncryptedMessage } from '@chat-app/shared/chat';
|
||||
import {
|
||||
type CallKind,
|
||||
@@ -114,8 +113,8 @@ import {
|
||||
type ScreenSharePreset,
|
||||
updateScreenShareSettings,
|
||||
} from '../lib/screenShareSettings';
|
||||
import { devLocalSecretStore } from '../lib/secretStore';
|
||||
import { supabase } from '../lib/supabase';
|
||||
import { cachedUserKey } from '../lib/userIdentity';
|
||||
import { setWindowFullscreen } from '../lib/windowFullscreen';
|
||||
|
||||
export type CallState =
|
||||
@@ -448,11 +447,7 @@ export function CallProvider({ children }: { children: ReactNode }) {
|
||||
) => {
|
||||
if (!session?.user.id || !device?.id) return;
|
||||
try {
|
||||
const priv = await loadDevicePrivateKey(
|
||||
devLocalSecretStore,
|
||||
session.user.id,
|
||||
device.id,
|
||||
);
|
||||
const priv = await cachedUserKey(session.user.id);
|
||||
if (!priv) return;
|
||||
const payload = JSON.stringify({
|
||||
v: 1,
|
||||
|
||||
Reference in New Issue
Block a user