Don't shadow file sharing functionality error
continuous-integration/drone/pr Build was killed
Details
continuous-integration/drone/pr Build was killed
Details
This commit is contained in:
parent
085b414bd8
commit
2058a51579
|
@ -635,6 +635,11 @@ func handleImagePreviews(profile peer.CwtchPeer, ev *event.Event, conversationID
|
||||||
settings := ReadGlobalSettings()
|
settings := ReadGlobalSettings()
|
||||||
fh, err := filesharing.PreviewFunctionalityGate(settings.Experiments)
|
fh, err := filesharing.PreviewFunctionalityGate(settings.Experiments)
|
||||||
|
|
||||||
|
// Short-circuit if file sharing is disabled
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Short-circuit failures
|
// Short-circuit failures
|
||||||
// Don't autodownload images if the download path does not exist.
|
// Don't autodownload images if the download path does not exist.
|
||||||
if settings.DownloadPath == "" {
|
if settings.DownloadPath == "" {
|
||||||
|
@ -646,8 +651,9 @@ func handleImagePreviews(profile peer.CwtchPeer, ev *event.Event, conversationID
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now look at the image preview experiment
|
||||||
imagePreviewsEnabled := settings.Experiments["filesharing-images"]
|
imagePreviewsEnabled := settings.Experiments["filesharing-images"]
|
||||||
if err == nil && imagePreviewsEnabled {
|
if imagePreviewsEnabled {
|
||||||
var cm model.MessageWrapper
|
var cm model.MessageWrapper
|
||||||
err := json.Unmarshal([]byte(ev.Data[event.Data]), &cm)
|
err := json.Unmarshal([]byte(ev.Data[event.Data]), &cm)
|
||||||
if err == nil && cm.Overlay == model.OverlayFileSharing {
|
if err == nil && cm.Overlay == model.OverlayFileSharing {
|
||||||
|
|
Reference in New Issue