Accessing images embedded into DMs requires proper OAuth token.
There is no way to tweak headers for an image request from QML - so we instead implement an image provider (subclass of QQuickImageProvider) that can pass custom headers alongside the request it sends.
Implemented image provider captures all http://dm/<auth-token> requests and then requests images passing the given auth-token as Authorization header. Image URL itself is extracted from the realm parameter of the auth token.
The rest of the changes are simple plumbing passing media url from API into the database and into the model.
Accessing images embedded into DMs requires proper OAuth token.
There is no way to tweak headers for an image request from QML - so we instead implement an image provider (subclass of
QQuickImageProvider
) that can pass custom headers alongside the request it sends.Implemented image provider captures all
http://dm/<auth-token>
requests and then requests images passing the given auth-token asAuthorization
header. Image URL itself is extracted from therealm
parameter of the auth token.The rest of the changes are simple plumbing passing media url from API into the database and into the model.