adding CheckDownloadStatus
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
erinn 2021-09-29 13:30:10 -07:00
parent a770de3aed
commit 24b72da0cc
1 changed files with 17 additions and 0 deletions

17
lib.go
View File

@ -707,6 +707,23 @@ func DownloadFile(profileOnion, handle, filepath, manifestpath, filekey string)
}
}
//export c_CheckDownloadStatus
func c_CheckDownloadStatus(profilePtr *C.char, profileLen C.int, fileKeyPtr *C.char, fileKeyLen C.int) {
CheckDownloadStatus(C.GoStringN(profilePtr, profileLen), C.GoStringN(fileKeyPtr, fileKeyLen))
}
func CheckDownloadStatus(profileOnion, fileKey string) {
profile := application.GetPeer(profileOnion)
if path, exists := profile.GetAttribute(attr.GetLocalScope(fileKey)); exists {
eventHandler.Push(event.NewEvent(event.FileDownloaded, map[event.Field]string{
ProfileOnion: profileOnion,
event.FileKey: fileKey,
event.FilePath: path,
event.TempFile: "",
}))
}
}
//export c_ResetTor
func c_ResetTor() {
ResetTor()