forked from cwtch.im/cwtch
Fix non-image/preview downloads in Android
This commit is contained in:
parent
aaabb12b6c
commit
ec71e56d23
|
@ -272,6 +272,12 @@ func (f *Functionality) DownloadFile(profile peer.CwtchPeer, conversationID int,
|
|||
}
|
||||
|
||||
// Don't download files if the download file directory does not exist
|
||||
// Unless we are on Android where the kernel wishes to keep us ignorant of the
|
||||
// actual path and/or existence of the file. We handle this case further down
|
||||
// the line when the manifest is received and protocol engine and the Android layer
|
||||
// negotiate a temporary local file -> final file copy. We don't want to worry
|
||||
// about that here...
|
||||
if runtime.GOOS != "android" {
|
||||
if _, err := os.Stat(path.Dir(downloadFilePath)); os.IsNotExist(err) {
|
||||
return errors.New("download directory does not exist")
|
||||
}
|
||||
|
@ -280,7 +286,7 @@ func (f *Functionality) DownloadFile(profile peer.CwtchPeer, conversationID int,
|
|||
if _, err := os.Stat(path.Dir(manifestFilePath)); os.IsNotExist(err) {
|
||||
return errors.New("manifest directory does not exist")
|
||||
}
|
||||
|
||||
}
|
||||
// Store local.filesharing.filekey.manifest as the location of the manifest
|
||||
profile.SetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.manifest", key), manifestFilePath)
|
||||
|
||||
|
|
Loading…
Reference in New Issue