adding CheckDownloadStatus
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
a770de3aed
commit
24b72da0cc
17
lib.go
17
lib.go
|
@ -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
|
//export c_ResetTor
|
||||||
func c_ResetTor() {
|
func c_ResetTor() {
|
||||||
ResetTor()
|
ResetTor()
|
||||||
|
|
Reference in New Issue