Browse Source

adding CheckDownloadStatus

pull/28/head
erinn 11 months ago
parent
commit
24b72da0cc
  1. 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
func c_ResetTor() {
ResetTor()

Loading…
Cancel
Save