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