Merge branch 'client-cleanup-unused' into 'master'
[Client] Remove unused variable in upload See merge request famedly/famedlysdk!226
This commit is contained in:
commit
bd3ac2ed3e
|
@ -875,7 +875,6 @@ class Client {
|
||||||
/// Uploads a file with the name [fileName] as base64 encoded to the server
|
/// Uploads a file with the name [fileName] as base64 encoded to the server
|
||||||
/// and returns the mxc url as a string.
|
/// and returns the mxc url as a string.
|
||||||
Future<String> upload(MatrixFile file) async {
|
Future<String> upload(MatrixFile file) async {
|
||||||
dynamic fileBytes;
|
|
||||||
// For testing
|
// For testing
|
||||||
if (this.homeserver.toLowerCase() == "https://fakeserver.notexisting") {
|
if (this.homeserver.toLowerCase() == "https://fakeserver.notexisting") {
|
||||||
return "mxc://example.com/AQwafuaFswefuhsfAFAgsw";
|
return "mxc://example.com/AQwafuaFswefuhsfAFAgsw";
|
||||||
|
@ -890,7 +889,7 @@ class Client {
|
||||||
streamedRequest.contentLength = await file.bytes.length;
|
streamedRequest.contentLength = await file.bytes.length;
|
||||||
streamedRequest.sink.add(file.bytes);
|
streamedRequest.sink.add(file.bytes);
|
||||||
streamedRequest.sink.close();
|
streamedRequest.sink.close();
|
||||||
print("[UPLOADING] $fileName, size: ${fileBytes?.length}");
|
print("[UPLOADING] $fileName");
|
||||||
var streamedResponse = await streamedRequest.send();
|
var streamedResponse = await streamedRequest.send();
|
||||||
Map<String, dynamic> jsonResponse = json.decode(
|
Map<String, dynamic> jsonResponse = json.decode(
|
||||||
String.fromCharCodes(await streamedResponse.stream.first),
|
String.fromCharCodes(await streamedResponse.stream.first),
|
||||||
|
|
Loading…
Reference in a new issue