diff --git a/functionality/filesharing/filesharing_functionality.go b/functionality/filesharing/filesharing_functionality.go index 60e3d18..bc14e5b 100644 --- a/functionality/filesharing/filesharing_functionality.go +++ b/functionality/filesharing/filesharing_functionality.go @@ -115,6 +115,7 @@ func (f *Functionality) RestartFileShare(profile peer.CwtchPeer, filekey string) manifest, manifestExists := profile.GetScopedZonedAttribute(attr.ConversationScope, attr.FilesharingZone, fmt.Sprintf("%s.manifest", filekey)) if manifestExists { // everything is in order, so reshare this file with the engine + log.Debugf("restarting file share: %v", filekey) profile.ShareFile(filekey, manifest) return nil } @@ -132,6 +133,7 @@ func (f *Functionality) ReShareFiles(profile peer.CwtchPeer) error { for _, key := range keys { // only look at timestamp keys // this is an arbitrary choice + if strings.HasSuffix(key, ".ts") { _, zonedpath := attr.ParseScope(key) _, keypath := attr.ParseZone(zonedpath) @@ -148,7 +150,12 @@ func (f *Functionality) ReShareFiles(profile peer.CwtchPeer) error { // Then attempt to share this file again... // TODO: In the future this would be the point to change the timestamp and reshare the file... if err == nil && sharedFile.Active { - f.RestartFileShare(profile, filekey) + err := f.RestartFileShare(profile, filekey) + if err != nil { + log.Errorf("could not reshare file: %v", err) + } + } else { + log.Errorf("could not get fileshare info %v", err) } } } diff --git a/protocol/files/filesharing_subsystem.go b/protocol/files/filesharing_subsystem.go index 4b85b3d..2d63b81 100644 --- a/protocol/files/filesharing_subsystem.go +++ b/protocol/files/filesharing_subsystem.go @@ -34,6 +34,7 @@ func (fsss *FileSharingSubSystem) ShareFile(fileKey string, serializedManifest s log.Errorf("could not share file %v", err) return } + log.Debugf("sharing file: %v %v", fileKey, serializedManifest) fsss.activeShares.Store(fileKey, &manifest) }