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..add10ffa30 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,16 @@ private void resetPublishButtonText() { public void updatePublishButtonState(){ uuid=null; + // pixelfed only allows posts with images, but replies can be text-only + boolean isValidPixelfedPost=!isInstancePixelfed() || (replyTo==null || !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){