Fix threading issue

This commit is contained in:
Niels Andriesse 2021-06-30 13:15:39 +10:00
parent d3704a6905
commit 4989bf4b8b
3 changed files with 7 additions and 7 deletions

View File

@ -382,10 +382,12 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
// endregion
override fun onModified(recipient: Recipient) {
if (thread.isContactRecipient) {
blockedBanner.isVisible = thread.isBlocked
runOnUiThread {
if (thread.isContactRecipient) {
blockedBanner.isVisible = thread.isBlocked
}
updateSubtitle()
}
updateSubtitle()
}
private fun markAllAsRead() {

View File

@ -411,7 +411,6 @@ public class SmsDatabase extends MessagingDatabase {
notifyConversationListeners(threadId);
return Optional.of(new InsertResult(messageId, threadId));
}
}

View File

@ -1,6 +1,5 @@
package org.thoughtcrime.securesms.database
import android.app.job.JobScheduler
import android.content.Context
import android.net.Uri
import org.session.libsession.database.StorageProtocol
@ -105,7 +104,7 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
}
else -> Optional.absent()
}
val pointerAttachments = attachments.mapNotNull {
val pointers = attachments.mapNotNull {
it.toSignalAttachment()
}
val targetAddress = if (isUserSender && !message.syncTarget.isNullOrEmpty()) {
@ -121,7 +120,7 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
val linkPreviews: Optional<List<LinkPreview>> = if (linkPreview.isEmpty()) Optional.absent() else Optional.of(linkPreview.mapNotNull { it!! })
val mmsDatabase = DatabaseFactory.getMmsDatabase(context)
val insertResult = if (message.sender == getUserPublicKey()) {
val mediaMessage = OutgoingMediaMessage.from(message, targetRecipient, pointerAttachments, quote.orNull(), linkPreviews.orNull()?.firstOrNull())
val mediaMessage = OutgoingMediaMessage.from(message, targetRecipient, pointers, quote.orNull(), linkPreviews.orNull()?.firstOrNull())
mmsDatabase.insertSecureDecryptedMessageOutbox(mediaMessage, message.threadID ?: -1, message.sentTimestamp!!)
} else {
// It seems like we have replaced SignalServiceAttachment with SessionServiceAttachment