|
|
|
@ -74,7 +74,7 @@ func (om *OverlayMessage) ShouldAutoDL() bool {
|
|
|
|
|
|
|
|
|
|
// DownloadFile given a profile, a conversation handle and a file sharing key, start off a download process
|
|
|
|
|
// to downloadFilePath
|
|
|
|
|
func (f *Functionality) DownloadFile(profile peer.CwtchPeer, conversationID int, downloadFilePath string, manifestFilePath string, key string, limit int) {
|
|
|
|
|
func (f *Functionality) DownloadFile(profile peer.CwtchPeer, conversationID int, downloadFilePath string, manifestFilePath string, key string, limit uint64) {
|
|
|
|
|
|
|
|
|
|
// Store local.filesharing.filekey.manifest as the location of the manifest
|
|
|
|
|
profile.SetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.manifest", key), manifestFilePath)
|
|
|
|
@ -83,7 +83,7 @@ func (f *Functionality) DownloadFile(profile peer.CwtchPeer, conversationID int,
|
|
|
|
|
profile.SetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.path", key), downloadFilePath)
|
|
|
|
|
|
|
|
|
|
// Store local.filesharing.filekey.limit as the max file size of the download
|
|
|
|
|
profile.SetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.limit", key), strconv.Itoa(limit))
|
|
|
|
|
profile.SetScopedZonedAttribute(attr.LocalScope, attr.FilesharingZone, fmt.Sprintf("%s.limit", key), strconv.FormatUint(limit, 10))
|
|
|
|
|
|
|
|
|
|
// Get the value of conversation.filesharing.filekey.manifest.size from `handle`
|
|
|
|
|
profile.SendScopedZonedGetValToContact(conversationID, attr.ConversationScope, attr.FilesharingZone, fmt.Sprintf("%s.manifest.size", key))
|
|
|
|
|