Merge pull request 'Prevent Sharing Files on Android for Now' (#194) from android-files into trunk

Reviewed-on: cwtch.im/cwtch-ui#194
This commit is contained in:
Dan Ballard 2021-10-01 15:05:36 +00:00
commit d070b7141e
2 changed files with 11 additions and 7 deletions

View File

@ -231,8 +231,10 @@ class FlwtchWorker(context: Context, parameters: WorkerParameters) :
val filepath = (a.get("filepath") as? String) ?: "" val filepath = (a.get("filepath") as? String) ?: ""
val manifestpath = (a.get("manifestpath") as? String) ?: "" val manifestpath = (a.get("manifestpath") as? String) ?: ""
val filekey = (a.get("filekey") as? String) ?: "" val filekey = (a.get("filekey") as? String) ?: ""
Log.i("FlwtchWorker::DownloadFile", "DownloadFile("+filepath+", "+manifestpath+")") // FIXME: Prevent spurious calls by Intent
Cwtch.downloadFile(profile, handle, filepath, manifestpath, filekey) if (profile != "") {
Cwtch.downloadFile(profile, handle, filepath, manifestpath, filekey)
}
} }
"CheckDownloadStatus" -> { "CheckDownloadStatus" -> {
val profile = (a.get("ProfileOnion") as? String) ?: "" val profile = (a.get("ProfileOnion") as? String) ?: ""

View File

@ -83,11 +83,13 @@ class _MessageViewState extends State<MessageView> {
var appBarButtons = <Widget>[]; var appBarButtons = <Widget>[];
if (Provider.of<ContactInfoState>(context).isOnline()) { if (Provider.of<ContactInfoState>(context).isOnline()) {
appBarButtons.add(IconButton( if (Platform.isAndroid == false) {
icon: Icon(Icons.attach_file, size: 24), appBarButtons.add(IconButton(
tooltip: AppLocalizations.of(context)!.tooltipSendFile, icon: Icon(Icons.attach_file, size: 24),
onPressed: _showFilePicker, tooltip: AppLocalizations.of(context)!.tooltipSendFile,
)); onPressed: _showFilePicker,
));
}
appBarButtons.add(IconButton( appBarButtons.add(IconButton(
icon: Icon(CwtchIcons.send_invite, size: 24), icon: Icon(CwtchIcons.send_invite, size: 24),
tooltip: AppLocalizations.of(context)!.sendInvite, tooltip: AppLocalizations.of(context)!.sendInvite,