|
|
|
@ -103,13 +103,13 @@ func (i *ImagePreviewsFunctionality) handleImagePreviews(profile peer.CwtchPeer,
|
|
|
|
|
// Short-circuit failures
|
|
|
|
|
// Don't autodownload images if the download path does not exist.
|
|
|
|
|
if i.downloadFolder == "" {
|
|
|
|
|
log.Debugf("download folder %v is not set", i.downloadFolder)
|
|
|
|
|
log.Errorf("download folder %v is not set", i.downloadFolder)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Don't autodownload images if the download path does not exist.
|
|
|
|
|
if _, err := os.Stat(i.downloadFolder); os.IsNotExist(err) {
|
|
|
|
|
log.Debugf("download folder %v does not exist", i.downloadFolder)
|
|
|
|
|
log.Errorf("download folder %v does not exist", i.downloadFolder)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -127,7 +127,7 @@ func (i *ImagePreviewsFunctionality) handleImagePreviews(profile peer.CwtchPeer,
|
|
|
|
|
if fm.ShouldAutoDL() {
|
|
|
|
|
basepath := i.downloadFolder
|
|
|
|
|
fp, mp := GenerateDownloadPath(basepath, fm.Name, false)
|
|
|
|
|
log.Debugf("autodownloading file!")
|
|
|
|
|
log.Debugf("autodownloading file! %v %v %v", basepath, fp, i.downloadFolder)
|
|
|
|
|
ev.Data["Auto"] = constants.True
|
|
|
|
|
mID, _ := strconv.Atoi(ev.Data["Index"])
|
|
|
|
|
profile.UpdateMessageAttribute(conversationID, 0, mID, constants.AttrDownloaded, constants.True)
|
|
|
|
|