From 222e2c6f3647911a2922f132d89abec1c937db85 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 1 Oct 2021 07:52:49 -0700 Subject: [PATCH] Prevent Sharing Files on Android for Now --- .../kotlin/im/cwtch/flwtch/FlwtchWorker.kt | 6 +++-- lib/views/messageview.dart | 24 ++++++++++--------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt b/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt index d18bb0d9..f4ef3152 100644 --- a/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt +++ b/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt @@ -231,8 +231,10 @@ class FlwtchWorker(context: Context, parameters: WorkerParameters) : val filepath = (a.get("filepath") as? String) ?: "" val manifestpath = (a.get("manifestpath") as? String) ?: "" val filekey = (a.get("filekey") as? String) ?: "" - Log.i("FlwtchWorker::DownloadFile", "DownloadFile("+filepath+", "+manifestpath+")") - Cwtch.downloadFile(profile, handle, filepath, manifestpath, filekey) + // FIXME: Prevent spurious calls by Intent + if (profile != "") { + Cwtch.downloadFile(profile, handle, filepath, manifestpath, filekey) + } } "CheckDownloadStatus" -> { val profile = (a.get("ProfileOnion") as? String) ?: "" diff --git a/lib/views/messageview.dart b/lib/views/messageview.dart index d279db17..c8484b84 100644 --- a/lib/views/messageview.dart +++ b/lib/views/messageview.dart @@ -83,17 +83,19 @@ class _MessageViewState extends State { var appBarButtons = []; if (Provider.of(context).isOnline()) { - appBarButtons.add(IconButton( - icon: Icon(Icons.attach_file, size: 24), - tooltip: AppLocalizations.of(context)!.tooltipSendFile, - onPressed: _showFilePicker, - )); - appBarButtons.add(IconButton( - icon: Icon(CwtchIcons.send_invite, size: 24), - tooltip: AppLocalizations.of(context)!.sendInvite, - onPressed: () { - _modalSendInvitation(context); - })); + if (Platform.isAndroid == false) { + appBarButtons.add(IconButton( + icon: Icon(Icons.attach_file, size: 24), + tooltip: AppLocalizations.of(context)!.tooltipSendFile, + onPressed: _showFilePicker, + )); + } + appBarButtons.add(IconButton( + icon: Icon(CwtchIcons.send_invite, size: 24), + tooltip: AppLocalizations.of(context)!.sendInvite, + onPressed: () { + _modalSendInvitation(context); + })); } appBarButtons.add(IconButton( icon: Provider.of(context, listen: false).isGroup == true ? Icon(CwtchIcons.group_settings_24px) : Icon(CwtchIcons.peer_settings_24px),