Merge remote-tracking branch 'origin/disappearing-messages' into disappearing-messages

# Conflicts:
#	app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt
#	app/src/main/java/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java
#	libsession/src/main/java/org/session/libsession/messaging/messages/control/MessageRequestResponse.kt
#	libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt
#	libsession/src/main/java/org/session/libsession/messaging/utilities/UpdateMessageBuilder.kt
#	libsignal/src/main/java/org/session/libsignal/protos/SignalServiceProtos.java
This commit is contained in:
0x330a 2023-07-25 13:14:29 +10:00
commit 36df2b37df
7 changed files with 180 additions and 1214 deletions

View File

@ -166,6 +166,7 @@ import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
import org.thoughtcrime.securesms.util.DateUtils import org.thoughtcrime.securesms.util.DateUtils
import org.thoughtcrime.securesms.util.MediaUtil import org.thoughtcrime.securesms.util.MediaUtil
import org.thoughtcrime.securesms.util.SaveAttachmentTask import org.thoughtcrime.securesms.util.SaveAttachmentTask
import org.thoughtcrime.securesms.util.drawToBitmap
import org.thoughtcrime.securesms.util.isScrolledToBottom import org.thoughtcrime.securesms.util.isScrolledToBottom
import org.thoughtcrime.securesms.util.push import org.thoughtcrime.securesms.util.push
import org.thoughtcrime.securesms.util.show import org.thoughtcrime.securesms.util.show

View File

@ -92,7 +92,7 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
private static final int lokiV43 = 64; private static final int lokiV43 = 64;
// Loki - onUpgrade(...) must be updated to use Loki version numbers if Signal makes any database changes // Loki - onUpgrade(...) must be updated to use Loki version numbers if Signal makes any database changes
private static final int DATABASE_VERSION = lokiV42; private static final int DATABASE_VERSION = lokiV43;
private static final int MIN_DATABASE_VERSION = lokiV7; private static final int MIN_DATABASE_VERSION = lokiV7;
private static final String CIPHER3_DATABASE_NAME = "signal.db"; private static final String CIPHER3_DATABASE_NAME = "signal.db";
public static final String DATABASE_NAME = "signal_v4.db"; public static final String DATABASE_NAME = "signal_v4.db";

View File

@ -33,7 +33,6 @@
android:id="@+id/textView" android:id="@+id/textView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/AccessibilityId_configuration_message"
android:gravity="center" android:gravity="center"
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
android:textSize="@dimen/very_small_font_size" android:textSize="@dimen/very_small_font_size"

View File

@ -19,8 +19,8 @@ class MessageRequestResponse(val isApproved: Boolean, var profile: Profile? = nu
profile?.profileKey?.let { messageRequestResponseProto.profileKey = ByteString.copyFrom(it) } profile?.profileKey?.let { messageRequestResponseProto.profileKey = ByteString.copyFrom(it) }
return try { return try {
SignalServiceProtos.Content.newBuilder() SignalServiceProtos.Content.newBuilder()
.setMessageRequestResponse(messageRequestResponseProto.build())
.setExpirationConfigurationIfNeeded(threadID) .setExpirationConfigurationIfNeeded(threadID)
.setMessageRequestResponse(messageRequestResponseProto.build())
.build() .build()
} catch (e: Exception) { } catch (e: Exception) {
Log.w(TAG, "Couldn't construct message request response proto from: $this") Log.w(TAG, "Couldn't construct message request response proto from: $this")

View File

@ -15,6 +15,7 @@ import org.session.libsession.messaging.messages.control.ExpirationTimerUpdate
import org.session.libsession.messaging.messages.control.MessageRequestResponse import org.session.libsession.messaging.messages.control.MessageRequestResponse
import org.session.libsession.messaging.messages.control.SharedConfigurationMessage import org.session.libsession.messaging.messages.control.SharedConfigurationMessage
import org.session.libsession.messaging.messages.control.UnsendRequest import org.session.libsession.messaging.messages.control.UnsendRequest
import org.session.libsession.messaging.messages.control.UnsendRequest
import org.session.libsession.messaging.messages.visible.LinkPreview import org.session.libsession.messaging.messages.visible.LinkPreview
import org.session.libsession.messaging.messages.visible.Quote import org.session.libsession.messaging.messages.visible.Quote
import org.session.libsession.messaging.messages.visible.VisibleMessage import org.session.libsession.messaging.messages.visible.VisibleMessage
@ -34,7 +35,12 @@ import org.session.libsession.utilities.SSKEnvironment
import org.session.libsignal.crypto.PushTransportDetails import org.session.libsignal.crypto.PushTransportDetails
import org.session.libsignal.protos.SignalServiceProtos import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType import org.session.libsignal.protos.SignalServiceProtos.Content.ExpirationType
import org.session.libsignal.utilities.* import org.session.libsignal.utilities.Base64
import org.session.libsignal.utilities.IdPrefix
import org.session.libsignal.utilities.Namespace
import org.session.libsignal.utilities.defaultRequiresAuth
import org.session.libsignal.utilities.hasNamespaces
import org.session.libsignal.utilities.hexEncodedPublicKey
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
import org.session.libsession.messaging.sending_receiving.attachments.Attachment as SignalAttachment import org.session.libsession.messaging.sending_receiving.attachments.Attachment as SignalAttachment

View File

@ -104,8 +104,8 @@ object UpdateMessageBuilder {
} }
} else { } else {
val time = ExpirationUtil.getExpirationDisplayValue(context, duration.toInt()) val time = ExpirationUtil.getExpirationDisplayValue(context, duration.toInt())
val threadId = storage.getThreadId(Address.fromSerialized(senderId!!)) ?: return "" val threadId = storage.getThreadId(Address.fromSerialized(senderId!!))
val config = storage.getExpirationConfiguration(threadId) val config = threadId?.let { storage.getExpirationConfiguration(it) }
val state = when (config?.expirationType) { val state = when (config?.expirationType) {
ExpirationType.DELETE_AFTER_SEND -> context.getString(R.string.MessageRecord_state_sent) ExpirationType.DELETE_AFTER_SEND -> context.getString(R.string.MessageRecord_state_sent)
ExpirationType.DELETE_AFTER_READ -> context.getString(R.string.MessageRecord_state_read) ExpirationType.DELETE_AFTER_READ -> context.getString(R.string.MessageRecord_state_read)