Merge branch 'dev' into on

This commit is contained in:
Andrew 2024-03-16 14:27:18 +10:30
commit d083b19a12
5 changed files with 13 additions and 16 deletions

View File

@ -31,8 +31,8 @@ configurations.all {
exclude module: "commons-logging"
}
def canonicalVersionCode = 360
def canonicalVersionName = "1.17.5"
def canonicalVersionCode = 369
def canonicalVersionName = "1.18.1"
def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,

View File

@ -182,7 +182,7 @@ open class Storage(
}
override fun getUserProfile(): Profile {
val displayName = TextSecurePreferences.getProfileName(context)!!
val displayName = TextSecurePreferences.getProfileName(context)
val profileKey = ProfileKeyUtil.getProfileKey(context)
val profilePictureUrl = TextSecurePreferences.getProfilePictureURL(context)
return Profile(displayName, profileKey, profilePictureUrl)

View File

@ -53,6 +53,7 @@ class DisappearingMessagesViewModelTest {
@Mock lateinit var application: Application
@Mock lateinit var textSecurePreferences: TextSecurePreferences
@Mock lateinit var messageExpirationManager: SSKEnvironment.MessageExpirationManagerProtocol
@Mock lateinit var disappearingMessages: DisappearingMessages
@Mock lateinit var threadDb: ThreadDatabase
@Mock lateinit var groupDb: GroupDatabase
@Mock lateinit var storage: Storage
@ -114,9 +115,9 @@ class DisappearingMessagesViewModelTest {
isSelfAdmin = true,
address = LOCAL_ADDRESS,
isNoteToSelf = true,
expiryMode = ExpiryMode.NONE,
expiryMode = ExpiryMode.Legacy(0),
isNewConfigEnabled = false,
persistedMode = ExpiryMode.NONE,
persistedMode = ExpiryMode.Legacy(0),
showDebugOptions = false
)
)
@ -127,7 +128,7 @@ class DisappearingMessagesViewModelTest {
UiState(
OptionsCard(
R.string.activity_disappearing_messages_timer,
typeOption(ExpiryMode.NONE, selected = true),
typeOption(ExpiryMode.NONE, selected = false),
timeOption(ExpiryType.LEGACY, 12.hours),
timeOption(ExpiryType.LEGACY, 1.days),
timeOption(ExpiryType.LEGACY, 7.days),
@ -555,6 +556,7 @@ class DisappearingMessagesViewModelTest {
application,
textSecurePreferences,
messageExpirationManager,
disappearingMessages,
threadDb,
groupDb,
storage,

View File

@ -10,7 +10,7 @@ data class ExpirationConfiguration(
val isEnabled = expiryMode.expirySeconds > 0
companion object {
val isNewConfigEnabled = true /* TODO: System.currentTimeMillis() > 1_676_851_200_000 // 13/02/2023 */
val isNewConfigEnabled = true
}
}

View File

@ -4,10 +4,11 @@ import com.google.protobuf.ByteString
import org.session.libsignal.utilities.Log
import org.session.libsignal.protos.SignalServiceProtos
class Profile() {
var displayName: String? = null
var profileKey: ByteArray? = null
class Profile(
var displayName: String? = null,
var profileKey: ByteArray? = null,
var profilePictureURL: String? = null
) {
companion object {
const val TAG = "Profile"
@ -25,12 +26,6 @@ class Profile() {
}
}
constructor(displayName: String, profileKey: ByteArray? = null, profilePictureURL: String? = null) : this() {
this.displayName = displayName
this.profileKey = profileKey
this.profilePictureURL = profilePictureURL
}
fun toProto(): SignalServiceProtos.DataMessage? {
val displayName = displayName
if (displayName == null) {