hide 'add attachment' in chats that cannot send messages

This commit is contained in:
B. Petersen 2020-04-05 11:59:34 +02:00
parent 0a3dee4573
commit 158d272419
No known key found for this signature in database
GPG key ID: 3B88E92DEA8E9AFC

View file

@ -486,6 +486,13 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
Log.e(TAG, "cannot set up in-chat-search: ", e); Log.e(TAG, "cannot set up in-chat-search: ", e);
} }
if (!dcChat.canSend()) {
MenuItem attachItem = menu.findItem(R.id.menu_add_attachment);
if (attachItem!=null) {
attachItem.setVisible(false);
}
}
super.onPrepareOptionsMenu(menu); super.onPrepareOptionsMenu(menu);
return true; return true;
} }