mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
hide resend menu option if messages are not outgoing
This commit is contained in:
@@ -333,13 +333,21 @@ public class ConversationFragment extends MessageSelectorFragment
|
||||
|
||||
// if one of the selected items cannot be saved, disable saving.
|
||||
boolean canSave = true;
|
||||
// if one of the selected items is not from self, disable resending.
|
||||
boolean canResend = true;
|
||||
for (DcMsg messageRecord : messageRecords) {
|
||||
if (!messageRecord.hasFile()) {
|
||||
if (canSave && !messageRecord.hasFile()) {
|
||||
canSave = false;
|
||||
}
|
||||
if (canResend && !messageRecord.isOutgoing()) {
|
||||
canResend = false;
|
||||
}
|
||||
if (!canSave && !canResend) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
menu.findItem(R.id.menu_context_save_attachment).setVisible(canSave);
|
||||
menu.findItem(R.id.menu_resend).setVisible(canResend);
|
||||
}
|
||||
|
||||
static boolean canReplyToMsg(DcMsg dcMsg) {
|
||||
|
||||
Reference in New Issue
Block a user