Compare commits

...

13 Commits

Author SHA1 Message Date
Andrew 36edca855c
Merge pull request #1430 from bemusementpark/fix-null-display-name
Fix NPE on null display name
2 months ago
0x330a 3dee7ec6bd
fix: disappearing viewmodel tests (#1432) 2 months ago
Andrew 3cba05e668 Fix NPE on null display name 2 months ago
0x330a 7bcf823740
build: update build number 3 months ago
0x330a ecc8f6e26f
Merge remote-tracking branch 'upstream/dev' 3 months ago
0x330a f88eab7323
build: update build number 3 months ago
0x330a b62656b1be
feat: add new config enabled timestamp 3 months ago
0x330a af1f2983c7
Merge remote-tracking branch 'upstream/master'
# Conflicts:
#	libsession/src/main/java/org/session/libsession/messaging/messages/ExpirationConfiguration.kt
3 months ago
0x330a c2ab92e14d
feat: add new config enabled timestamp 3 months ago
0x330a 1aec56b936
feat: add new config enabled timestamp 3 months ago
0x330a a4c99799a2
build: update build version 3 months ago
0x330a ae3ac3c16d
Merge branch 'dev' 3 months ago
Andrew bdb6e7d12b
Merge dev into master for 1.17.5 5 months ago

@ -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,

@ -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)

@ -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,

@ -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
}
}

@ -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) {

Loading…
Cancel
Save