diff --git a/crypto/devicelist.go b/crypto/devicelist.go index e554480d..bbe06aae 100644 --- a/crypto/devicelist.go +++ b/crypto/devicelist.go @@ -27,9 +27,8 @@ var ( InvalidKeySignature = errors.New("invalid signature on device keys") ) -func (mach *OlmMachine) LoadDevices(user id.UserID) map[id.DeviceID]*id.Device { - // TODO proper context? - return mach.fetchKeys(context.TODO(), []id.UserID{user}, "", true)[user] +func (mach *OlmMachine) LoadDevices(ctx context.Context, user id.UserID) map[id.DeviceID]*id.Device { + return mach.fetchKeys(ctx, []id.UserID{user}, "", true)[user] } func (mach *OlmMachine) storeDeviceSelfSignatures(ctx context.Context, userID id.UserID, deviceID id.DeviceID, resp *mautrix.RespQueryKeys) { diff --git a/crypto/machine.go b/crypto/machine.go index da78eaf7..fc0f1742 100644 --- a/crypto/machine.go +++ b/crypto/machine.go @@ -438,7 +438,7 @@ func (mach *OlmMachine) GetOrFetchDeviceByKey(ctx context.Context, userID id.Use Str("user_id", userID.String()). Str("identity_key", identityKey.String()). Msg("Didn't find identity in crypto store, fetching from server") - devices := mach.LoadDevices(userID) + devices := mach.LoadDevices(ctx, userID) for _, device := range devices { if device.IdentityKey == identityKey { return device, nil