mirror of
https://github.com/BlueBubblesApp/bluebubbles-app.git
synced 2025-08-06 11:19:56 +08:00
Fix web compile and sending web attachments
This commit is contained in:
@ -122,7 +122,7 @@ class Player {
|
||||
FutureOr<void> setShuffle(bool shuffle) {}
|
||||
}
|
||||
|
||||
abstract class VideoController {
|
||||
class VideoController {
|
||||
/// The [Player] instance associated with this [VideoController].
|
||||
final Player player;
|
||||
|
||||
@ -143,7 +143,7 @@ abstract class VideoController {
|
||||
|
||||
/// Disposes the [VideoController].
|
||||
/// Releases the allocated resources back to the system.
|
||||
Future<void> dispose();
|
||||
Future<void> dispose() async {}
|
||||
}
|
||||
|
||||
class Video extends StatefulWidget {
|
||||
|
@ -194,7 +194,7 @@ class ActionHandler extends GetxService {
|
||||
http.sendAttachment(
|
||||
c.guid,
|
||||
attachment.guid!,
|
||||
PlatformFile(name: attachment.transferName!, bytes: attachment.bytes, path: attachment.path, size: attachment.totalBytes ?? 0),
|
||||
PlatformFile(name: attachment.transferName!, bytes: attachment.bytes, path: kIsWeb ? null : attachment.path, size: attachment.totalBytes ?? 0),
|
||||
onSendProgress: (count, total) => progress.item2.value = count / attachment.bytes!.length,
|
||||
method: (ss.settings.enablePrivateAPI.value
|
||||
&& ss.settings.privateAPIAttachmentSend.value)
|
||||
|
@ -608,7 +608,7 @@ class HttpService extends GetxService {
|
||||
/// body of the message.
|
||||
Future<Response> sendAttachment(String chatGuid, String tempGuid, PlatformFile file, {void Function(int, int)? onSendProgress, String? method, String? effectId, String? subject, String? selectedMessageGuid, int? partIndex, bool? isAudioMessage, CancelToken? cancelToken}) async {
|
||||
return runApiGuarded(() async {
|
||||
final fileName = file.path!.split('/').last;
|
||||
final fileName = file.name;
|
||||
final formData = FormData.fromMap({
|
||||
"attachment": kIsWeb ? MultipartFile.fromBytes(file.bytes!, filename: fileName) : await MultipartFile.fromFile(file.path!, filename: fileName),
|
||||
"chatGuid": chatGuid,
|
||||
|
Reference in New Issue
Block a user