|
|
|
@ -1112,6 +1112,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|
|
|
|
val blindedRecipient = viewModel.blindedRecipient
|
|
|
|
|
val binding = binding ?: return
|
|
|
|
|
val openGroup = viewModel.openGroup
|
|
|
|
|
|
|
|
|
|
val (textResource, insertParam) = when {
|
|
|
|
|
recipient.isLocalNumber -> R.string.activity_conversation_empty_state_note_to_self to null
|
|
|
|
|
openGroup != null && !openGroup.canWrite -> R.string.activity_conversation_empty_state_read_only to recipient.toShortString()
|
|
|
|
@ -1883,11 +1884,13 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val allSentByCurrentUser = messages.all { it.isOutgoing }
|
|
|
|
|
val allHasHash = messages.all { lokiMessageDb.getMessageServerHash(it.id, it.isMms) != null }
|
|
|
|
|
|
|
|
|
|
// If the recipient is a community then we delete the message for everyone
|
|
|
|
|
if (recipient.isCommunityRecipient) {
|
|
|
|
|
// If the recipient is a community OR a Note-to-Self then we delete the message for everyone
|
|
|
|
|
if (recipient.isCommunityRecipient || recipient.isLocalNumber) {
|
|
|
|
|
val messageCount = 1 // Only used for plurals string
|
|
|
|
|
showSessionDialog {
|
|
|
|
|
title(resources.getQuantityString(R.plurals.ConversationFragment_delete_selected_messages, messageCount, messageCount))
|
|
|
|
@ -1917,8 +1920,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|
|
|
|
}
|
|
|
|
|
bottomSheet.show(supportFragmentManager, bottomSheet.tag)
|
|
|
|
|
}
|
|
|
|
|
else // Finally, if this is a closed group and you are deleting someone else's message(s)
|
|
|
|
|
// then we can only delete locally.
|
|
|
|
|
else // Finally, if this is a closed group and you are deleting someone else's message(s) then we can only delete locally.
|
|
|
|
|
{
|
|
|
|
|
val messageCount = 1
|
|
|
|
|
showSessionDialog {
|
|
|
|
@ -2027,7 +2029,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|
|
|
|
val message = messages.first() as MmsMessageRecord
|
|
|
|
|
|
|
|
|
|
// Do not allow the user to download a file attachment before it has finished downloading
|
|
|
|
|
// TODO: Localise the msg in this toast!
|
|
|
|
|
if (message.isMediaPending) {
|
|
|
|
|
Toast.makeText(this, resources.getString(R.string.conversation_activity__wait_until_attachment_has_finished_downloading), Toast.LENGTH_LONG).show()
|
|
|
|
|
return
|
|
|
|
|