Skip to main content

apply_keys_upload

Function apply_keys_upload 

Source
pub fn apply_keys_upload(
    conn: &mut Connection,
    caller_user_id: i64,
    caller_mxid: &str,
    caller_device_id: &str,
    request: &KeysUploadRequest,
    now: &str,
) -> Result<KeysUploadOutcome, MatrixError>
Expand description

DB-only core for POST /keys/upload: ownership check on device_keys, then insert / no-op / authenticated identity reset (see decide_device_keys_upload), OTK-id validation, and storage. On DeviceKeysUploadAction::Reset old one-time and fallback keys for this device are wiped before the new identity is stored. Returns whether device_keys actually changed (the caller wakes peers when it did).