fix: http api call replaced with httpClient
Signed-off-by: m_kushal <kushalmahapatro@gmail.com>
This commit is contained in:
parent
90e8d5b118
commit
d48542a023
|
|
@ -362,7 +362,7 @@ class Client extends MatrixApi {
|
||||||
String MatrixIdOrDomain,
|
String MatrixIdOrDomain,
|
||||||
) async {
|
) async {
|
||||||
try {
|
try {
|
||||||
final response = await http.get(Uri.https(
|
final response = await httpClient.get(Uri.https(
|
||||||
MatrixIdOrDomain.domain ?? '', '/.well-known/matrix/client'));
|
MatrixIdOrDomain.domain ?? '', '/.well-known/matrix/client'));
|
||||||
var respBody = response.body;
|
var respBody = response.body;
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:html/parser.dart';
|
import 'package:html/parser.dart';
|
||||||
import 'package:http/http.dart' as http;
|
|
||||||
|
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:matrix/src/utils/event_localizations.dart';
|
import 'package:matrix/src/utils/event_localizations.dart';
|
||||||
|
|
@ -607,7 +606,9 @@ class Event extends MatrixEvent {
|
||||||
|
|
||||||
// Download the file
|
// Download the file
|
||||||
if (uint8list == null) {
|
if (uint8list == null) {
|
||||||
downloadCallback ??= (Uri url) async => (await http.get(url)).bodyBytes;
|
final httpClient = room.client.httpClient;
|
||||||
|
downloadCallback ??=
|
||||||
|
(Uri url) async => (await httpClient.get(url)).bodyBytes;
|
||||||
uint8list = await downloadCallback(mxcUrl.getDownloadLink(room.client));
|
uint8list = await downloadCallback(mxcUrl.getDownloadLink(room.client));
|
||||||
storeable = database != null &&
|
storeable = database != null &&
|
||||||
storeable &&
|
storeable &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue