mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 12:07:26 +00:00
Fix/message deletion issues (#1697)
* SES-2810 - Removing the screenshot privacy toggle
* SES-2813 - clickable only when there is a 'follow settings'
* SES-2815 - proper icon and spacing for deleted messages
* Simplified deletion dialog to be reused for note to self and the rest as only the labels change
* SES-2819 - Do not show a reaction on a deleted message
* Fixing up deletion details
Message view hides reactions completely if the message is marked as deleted
All messages can now show the 'Delete' long press option
Community messages should be removed completely not marked as deleted
* Revert "SES-2819 - Do not show a reaction on a deleted message"
This reverts commit 711e31a43a
.
* Avoiding adding reactions if the message is marked as deleted
* Removing uneeded icon
* Deletion handled by VM so menu item is always visible
* SES-2811 - Do not attempt to send a failed message marked as deleted
* SES-2818 - Making sure we set the lastMessage in a thread properly, without using 'marked as deleted' messages
* SES-2464 - changed the behaviour to finish the convo activity but instead refresh the sarch on resume
* removing log
This commit is contained in:
@@ -38,6 +38,7 @@ interface MessageDataProvider {
|
||||
fun updateAudioAttachmentDuration(attachmentId: AttachmentId, durationMs: Long, threadId: Long)
|
||||
fun isMmsOutgoing(mmsMessageId: Long): Boolean
|
||||
fun isOutgoingMessage(timestamp: Long): Boolean
|
||||
fun isDeletedMessage(timestamp: Long): Boolean
|
||||
fun handleSuccessfulAttachmentUpload(attachmentId: Long, attachmentStream: SignalServiceAttachmentStream, attachmentKey: ByteArray, uploadResult: UploadResult)
|
||||
fun handleFailedAttachmentUpload(attachmentId: Long)
|
||||
fun getMessageForQuote(timestamp: Long, author: Address): Triple<Long, Boolean, String>?
|
||||
|
@@ -37,6 +37,13 @@ class MessageSendJob(val message: Message, val destination: Destination) : Job {
|
||||
val message = message as? VisibleMessage
|
||||
val storage = MessagingModuleConfiguration.shared.storage
|
||||
|
||||
// do not attempt to send if the message is marked as deleted
|
||||
message?.sentTimestamp?.let{
|
||||
if(messageDataProvider.isDeletedMessage(it)){
|
||||
return@execute
|
||||
}
|
||||
}
|
||||
|
||||
val sentTimestamp = this.message.sentTimestamp
|
||||
val sender = storage.getUserPublicKey()
|
||||
if (sentTimestamp != null && sender != null) {
|
||||
@@ -107,7 +114,10 @@ class MessageSendJob(val message: Message, val destination: Destination) : Job {
|
||||
Log.w(TAG, "Failed to send $message::class.simpleName.")
|
||||
val message = message as? VisibleMessage
|
||||
if (message != null) {
|
||||
if (!MessagingModuleConfiguration.shared.messageDataProvider.isOutgoingMessage(message.sentTimestamp!!)) {
|
||||
if (
|
||||
MessagingModuleConfiguration.shared.messageDataProvider.isDeletedMessage(message.sentTimestamp!!) ||
|
||||
!MessagingModuleConfiguration.shared.messageDataProvider.isOutgoingMessage(message.sentTimestamp!!)
|
||||
) {
|
||||
return // The message has been deleted
|
||||
}
|
||||
}
|
||||
|
@@ -469,9 +469,15 @@ object MessageSender {
|
||||
|
||||
fun handleFailedMessageSend(message: Message, error: Exception, isSyncMessage: Boolean = false) {
|
||||
val storage = MessagingModuleConfiguration.shared.storage
|
||||
val timestamp = message.sentTimestamp!!
|
||||
|
||||
// no need to handle if message is marked as deleted
|
||||
if(MessagingModuleConfiguration.shared.messageDataProvider.isDeletedMessage(message.sentTimestamp!!)){
|
||||
return
|
||||
}
|
||||
|
||||
val userPublicKey = storage.getUserPublicKey()!!
|
||||
|
||||
val timestamp = message.sentTimestamp!!
|
||||
val author = message.sender ?: userPublicKey
|
||||
|
||||
if (isSyncMessage) storage.markAsSyncFailed(timestamp, author, error)
|
||||
|
Reference in New Issue
Block a user