diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java index 0c87e48e99..3c34522d76 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -1051,13 +1051,17 @@ private void resetPublishButtonText() { public void updatePublishButtonState(){ uuid=null; + boolean isReply=replyTo!=null; + // pixelfed only allows posts with images, but replies can be text-only + boolean isValidPixelfedPost=!isInstancePixelfed() || (isReply || !mediaViewController.isEmpty()); + boolean isValidPost= isValidPixelfedPost && (trimmedCharCount>0 || !mediaViewController.isEmpty()) && charCount<=charLimit && mediaViewController.getNonDoneAttachmentCount()==0 && (pollViewController.isEmpty() || pollViewController.getNonEmptyOptionsCount()>1); if(GlobalUserPreferences.relocatePublishButton && publishButtonRelocated != null){ - publishButtonRelocated.setEnabled((!isInstancePixelfed() || !mediaViewController.isEmpty()) && (trimmedCharCount>0 || !mediaViewController.isEmpty()) && charCount<=charLimit && mediaViewController.getNonDoneAttachmentCount()==0 && (pollViewController.isEmpty() || pollViewController.getNonEmptyOptionsCount()>1)); + publishButtonRelocated.setEnabled(isValidPost); } if(publishButton==null) return; - publishButton.setEnabled((!isInstancePixelfed() || !mediaViewController.isEmpty()) && (trimmedCharCount>0 || !mediaViewController.isEmpty()) && charCount<=charLimit && mediaViewController.getNonDoneAttachmentCount()==0 && (pollViewController.isEmpty() || pollViewController.getNonEmptyOptionsCount()>1)); + publishButton.setEnabled(isValidPost); } private void onCustomEmojiClick(Emoji emoji){