diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index e365cec4..7c37a91b 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -244,6 +244,8 @@ function reconfigure_gnusocial { } function gnusocial_set_background_image { + GNUSOCIAL_DOMAIN_NAME=$(get_completion_param "gnusocial domain") + data=$(tempfile 2>/dev/null) trap "rm -f $data" 0 1 2 5 15 dialog --title $"GNU Social" \ diff --git a/src/freedombone-app-postactiv b/src/freedombone-app-postactiv index db6d62dc..644fce1f 100755 --- a/src/freedombone-app-postactiv +++ b/src/freedombone-app-postactiv @@ -228,6 +228,8 @@ function reconfigure_postactiv { } function postactiv_set_background_image { + POSTACTIV_DOMAIN_NAME=$(get_completion_param "postactiv domain") + data=$(tempfile 2>/dev/null) trap "rm -f $data" 0 1 2 5 15 dialog --title $"PostActiv" \ @@ -240,9 +242,11 @@ function postactiv_set_background_image { if [ ${#temp_background} -gt 0 ]; then POSTACTIV_BACKGROUND_IMAGE_URL="$temp_background" write_config_param "POSTACTIV_BACKGROUND_IMAGE_URL" "$POSTACTIV_BACKGROUND_IMAGE_URL" - pleroma_set_background_image_from_url "$POSTACTIV_DOMAIN_NAME" "$POSTACTIV_BACKGROUND_IMAGE_URL" "$POSTACTIV_TITLE" - dialog --title $"Set PostActiv background" \ - --msgbox $"The background image has been set" 6 60 + + if [[ $(pleroma_set_background_image_from_url "$POSTACTIV_DOMAIN_NAME" "$POSTACTIV_BACKGROUND_IMAGE_URL" "$POSTACTIV_TITLE" | tail -n 1) == "0" ]]; then + dialog --title $"Set PostActiv background" \ + --msgbox $"The background image has been set" 6 60 + fi fi ;; esac diff --git a/src/freedombone-utils-gnusocialtools b/src/freedombone-utils-gnusocialtools index aa9b6b5e..a0991a68 100755 --- a/src/freedombone-utils-gnusocialtools +++ b/src/freedombone-utils-gnusocialtools @@ -39,6 +39,11 @@ function pleroma_set_background_image_from_url { url="$2" title="$3" + if [ ${#domain_name} -eq 0 ]; then + echo "1" + return + fi + ext= if [ ${#url} -gt 0 ]; then if [[ "$url" == *".jpeg" || "$url" == *".jpg" ]]; then