getContent method
serverName The server name from the mxc:// URI (the authoritory component)
mediaId The media ID from the mxc:// URI (the path component)
allowRemote Indicates to the server that it should not attempt to fetch the media if
it is deemed remote. This is to prevent routing loops where the server
contacts itself.
Defaults to true if not provided.
timeoutMs The maximum number of milliseconds that the client is willing to wait to
start receiving data, in the case that the content has not yet been
uploaded. The default value is 20000 (20 seconds). The content
repository SHOULD impose a maximum value for this parameter. The
content repository MAY respond before the timeout.
allowRedirect Indicates to the server that it may return a 307 or 308 redirect
response that points at the relevant media content. When not explicitly
set to true the server must return the media content itself.
Implementation
@override
Future<FileResponse> getContent(
String serverName,
String mediaId, {
bool? allowRemote,
int? timeoutMs,
bool? allowRedirect,
}) async {
return (await authenticatedMediaSupported())
? getContentAuthed(serverName, mediaId, timeoutMs: timeoutMs)
// ignore: deprecated_member_use_from_same_package
: super.getContent(
serverName,
mediaId,
allowRemote: allowRemote,
timeoutMs: timeoutMs,
allowRedirect: allowRedirect,
);
}