Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.19.0 #1597

Merged
merged 47 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4b7f5d3
1.19.0 - Bumping release version and code
ThomasSession Jul 19, 2024
cbdd25a
Merge branch 'dev' into release/1.19.0
ThomasSession Jul 22, 2024
66c7884
Merge branch 'dev' into release/1.19.0
ThomasSession Jul 22, 2024
e813756
Adding the long press fix in 1.19.0
ThomasSession Jul 25, 2024
143d4c4
Show Account Created empty view only for newAccounts
Jul 26, 2024
af302d4
Change conversations heading in search
Jul 26, 2024
30279cc
Merge pull request #1572 from bemusementpark/qa-28
ThomasSession Jul 26, 2024
c883b8d
Merge pull request #1571 from bemusementpark/qa-20
ThomasSession Jul 26, 2024
456f8d0
Handling keyboard inset for Android sdk < 30
ThomasSession Jul 26, 2024
55ec4e1
Update app/src/main/java/org/thoughtcrime/securesms/conversation/star…
ThomasSession Jul 26, 2024
b4f13bb
Trimming the accound ID when validating it
ThomasSession Jul 26, 2024
2818552
Merge pull request #1574 from oxen-io/fix/next-button-and-blinded-search
ThomasSession Jul 26, 2024
80d08a5
Fix follow light
Jul 26, 2024
90f6fee
Change ThemeColorSet naming
Jul 26, 2024
49ecdfd
Fix app exit after Lock Screen
Jul 27, 2024
51a43d1
Merge pull request #1576 from oxen-io/fix/trimmed-account-id
ThomasSession Jul 28, 2024
648d372
Merge pull request #1578 from bemusementpark/lock
bemusementpark Jul 29, 2024
d964921
Fix dialog not shown on seed send attempt
Jul 29, 2024
1a3ffe1
Merge branch 'release/1.19.0' into fix-send-seed-dialog
Jul 29, 2024
32dbea1
Merge pull request #1580 from bemusementpark/fix-send-seed-dialog
bemusementpark Jul 29, 2024
492d521
Add colors lambda
Jul 29, 2024
5bd2724
Latest libsession
ThomasSession Jul 29, 2024
6fb0f17
Merge pull request #1581 from oxen-io/feature/update-libsession
ThomasSession Jul 29, 2024
25e7c7e
Simplify ThemeFromPreferences by removing lambdas
Jul 29, 2024
7bb1a3a
Suppress compose name warning
Jul 29, 2024
dba0ca9
JNI bridging for the new version blinded key api
ThomasSession Jul 29, 2024
d23d8f3
Fix double closing on memory file (#1579)
simophin Jul 29, 2024
447ea85
Improve naming
Jul 29, 2024
ce501fd
Move invalidateComposeThemeColors()
Jul 29, 2024
a796f05
Merge pull request #1577 from bemusementpark/dark-light
ThomasSession Jul 30, 2024
35a9f9f
Version fetching API added
ThomasSession Jul 30, 2024
d399057
Linking Version util to the app
ThomasSession Jul 30, 2024
42733c9
Clean up logic
ThomasSession Jul 30, 2024
4b87e92
Added a log so we can see when the version data is returned
ThomasSession Jul 30, 2024
83ea71d
Update app/src/main/java/org/thoughtcrime/securesms/util/VersionUtil.kt
ThomasSession Jul 30, 2024
7a8e130
PR feedback
ThomasSession Jul 30, 2024
a594952
Update libsession/src/main/java/org/session/libsession/snode/utilitie…
ThomasSession Jul 30, 2024
fc4bf6f
Merge pull request #1583 from oxen-io/feature/blinded-version
ThomasSession Jul 30, 2024
7fa3d9f
Fix version check
Jul 31, 2024
40db23d
Fix setLastVersion called onException
Jul 31, 2024
4992123
Cleanup comment
Jul 31, 2024
72d77a9
Add @JvmOverloads
Jul 31, 2024
8d15169
Version bump to go above last live version
ThomasSession Jul 31, 2024
5c4e95c
Update VersionDataFetcher KDoc
Aug 1, 2024
124d743
Merge pull request #1588 from oxen-io/feature/version-bump
ThomasSession Aug 1, 2024
0616e14
Merge pull request #1585 from bemusementpark/fix-version-check
ThomasSession Aug 1, 2024
982e23b
Merge branch 'dev' into release/1.19.0
ThomasSession Aug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ configurations.all {
exclude module: "commons-logging"
}

def canonicalVersionCode = 374
def canonicalVersionName = "1.18.5"
def canonicalVersionCode = 377
def canonicalVersionName = "1.19.0"

def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<activity
android:name="org.thoughtcrime.securesms.home.HomeActivity"
android:screenOrientation="portrait"
android:launchMode="standard"
android:launchMode="singleTask"
android:theme="@style/Theme.Session.DayNight.NoActionBar" />
<activity
android:name="org.thoughtcrime.securesms.messagerequests.MessageRequestsActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import org.thoughtcrime.securesms.sskenvironment.ReadReceiptManager;
import org.thoughtcrime.securesms.sskenvironment.TypingStatusRepository;
import org.thoughtcrime.securesms.util.Broadcaster;
import org.thoughtcrime.securesms.util.VersionDataFetcher;
import org.thoughtcrime.securesms.util.dynamiclanguage.LocaleParseHelper;
import org.thoughtcrime.securesms.webrtc.CallMessageProcessor;
import org.webrtc.PeerConnectionFactory;
Expand All @@ -110,7 +111,6 @@
import dagger.hilt.EntryPoints;
import dagger.hilt.android.HiltAndroidApp;
import kotlin.Unit;
import kotlinx.coroutines.Job;
import network.loki.messenger.BuildConfig;
import network.loki.messenger.libsession_util.ConfigBase;
import network.loki.messenger.libsession_util.UserProfile;
Expand Down Expand Up @@ -151,6 +151,7 @@ public class ApplicationContext extends Application implements DefaultLifecycleO
@Inject PushRegistry pushRegistry;
@Inject ConfigFactory configFactory;
@Inject LastSentTimestampCache lastSentTimestampCache;
@Inject VersionDataFetcher versionDataFetcher;
CallMessageProcessor callMessageProcessor;
MessagingModuleConfiguration messagingModuleConfiguration;

Expand Down Expand Up @@ -274,6 +275,9 @@ public void onStart(@NonNull LifecycleOwner owner) {

OpenGroupManager.INSTANCE.startPolling();
});

// fetch last version data
versionDataFetcher.startTimedVersionCheck();
}

@Override
Expand All @@ -286,12 +290,14 @@ public void onStop(@NonNull LifecycleOwner owner) {
poller.stopIfNeeded();
}
ClosedGroupPollerV2.getShared().stopAll();
versionDataFetcher.stopTimedVersionCheck();
}

@Override
public void onTerminate() {
stopKovenant(); // Loki
OpenGroupManager.INSTANCE.stopPolling();
versionDataFetcher.stopTimedVersionCheck();
super.onTerminate();
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/thoughtcrime/securesms/MuteDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fun showMuteDialog(

private enum class Option(@StringRes val stringRes: Int, val getTime: () -> Long) {
ONE_HOUR(R.string.arrays__mute_for_one_hour, duration = TimeUnit.HOURS.toMillis(1)),
TWO_HOURS(R.string.arrays__mute_for_two_hours, duration = TimeUnit.DAYS.toMillis(2)),
TWO_HOURS(R.string.arrays__mute_for_two_hours, duration = TimeUnit.HOURS.toMillis(2)),
ONE_DAY(R.string.arrays__mute_for_one_day, duration = TimeUnit.DAYS.toMillis(1)),
SEVEN_DAYS(R.string.arrays__mute_for_seven_days, duration = TimeUnit.DAYS.toMillis(7)),
FOREVER(R.string.arrays__mute_forever, getTime = { Long.MAX_VALUE });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ import org.thoughtcrime.securesms.groups.JoinCommunityFragment
@AndroidEntryPoint
class StartConversationFragment : BottomSheetDialogFragment(), StartConversationDelegate {

private val defaultPeekHeight: Int by lazy { (Resources.getSystem().displayMetrics.heightPixels * 0.94).toInt() }
companion object{
const val PEEK_RATIO = 0.94f
}

private val defaultPeekHeight: Int by lazy { (Resources.getSystem().displayMetrics.heightPixels * PEEK_RATIO).toInt() }

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package org.thoughtcrime.securesms.conversation.start.newmessage

import androidx.compose.animation.AnimatedVisibility
import android.graphics.Rect
import android.os.Build
import android.view.ViewTreeObserver
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
Expand All @@ -15,31 +18,45 @@ import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow
import network.loki.messenger.R
import org.thoughtcrime.securesms.onboarding.ui.ContinuePrimaryOutlineButton
import org.thoughtcrime.securesms.conversation.start.StartConversationFragment.Companion.PEEK_RATIO
import org.thoughtcrime.securesms.ui.LoadingArcOr
import org.thoughtcrime.securesms.ui.theme.LocalDimensions
import org.thoughtcrime.securesms.ui.theme.PreviewTheme
import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider
import org.thoughtcrime.securesms.ui.theme.ThemeColors
import org.thoughtcrime.securesms.ui.theme.LocalColors
import org.thoughtcrime.securesms.ui.components.AppBar
import org.thoughtcrime.securesms.ui.components.BorderlessButtonWithIcon
import org.thoughtcrime.securesms.ui.components.MaybeScanQrCode
import org.thoughtcrime.securesms.ui.components.PrimaryOutlineButton
import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField
import org.thoughtcrime.securesms.ui.components.SessionTabRow
import org.thoughtcrime.securesms.ui.contentDescription
import org.thoughtcrime.securesms.ui.theme.LocalColors
import org.thoughtcrime.securesms.ui.theme.LocalDimensions
import org.thoughtcrime.securesms.ui.theme.LocalType
import org.thoughtcrime.securesms.ui.theme.PreviewTheme
import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider
import org.thoughtcrime.securesms.ui.theme.ThemeColors
import kotlin.math.max

private val TITLES = listOf(R.string.enter_account_id, R.string.qrScan)

Expand Down Expand Up @@ -76,61 +93,111 @@ private fun EnterAccountId(
callbacks: Callbacks,
onHelp: () -> Unit = {}
) {
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
.imePadding()
) {
Column(
modifier = Modifier.padding(vertical = LocalDimensions.current.spacing),
horizontalAlignment = Alignment.CenterHorizontally,
// the scaffold is required to provide the contentPadding. That contentPadding is needed
// to properly handle the ime padding.
Scaffold() { contentPadding ->
// we need this extra surface to handle nested scrolling properly,
// because this scrollable component is inside a bottomSheet dialog which is itself scrollable
Surface(
modifier = Modifier.nestedScroll(rememberNestedScrollInteropConnection()),
color = LocalColors.current.backgroundSecondary
) {
SessionOutlinedTextField(
text = state.newMessageIdOrOns,
modifier = Modifier
.padding(horizontal = LocalDimensions.current.spacing),
contentDescription = "Session id input box",
placeholder = stringResource(R.string.accountIdOrOnsEnter),
onChange = callbacks::onChange,
onContinue = callbacks::onContinue,
error = state.error?.string(),
isTextErrorColor = state.isTextErrorColor
)

Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsSpacing))

BorderlessButtonWithIcon(
text = stringResource(R.string.messageNewDescription),
modifier = Modifier
.contentDescription(R.string.AccessibilityId_help_desk_link)
.padding(horizontal = LocalDimensions.current.mediumSpacing)
.fillMaxWidth(),
style = LocalType.current.small,
color = LocalColors.current.textSecondary,
iconRes = R.drawable.ic_circle_question_mark,
onClick = onHelp
)
}

Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing))
Spacer(Modifier.weight(2f))

PrimaryOutlineButton(
modifier = Modifier
.align(Alignment.CenterHorizontally)
.padding(horizontal = LocalDimensions.current.xlargeSpacing)
.padding(bottom = LocalDimensions.current.smallSpacing)
.fillMaxWidth()
.contentDescription(R.string.next),
enabled = state.isNextButtonEnabled,
onClick = callbacks::onContinue
) {
LoadingArcOr(state.loading) {
Text(stringResource(R.string.next))
var accountModifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())

// There is a known issue with the ime padding on android versions below 30
/// So on these older versions we need to resort to some manual padding based on the visible height
// when the keyboard is up
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
val keyboardHeight by keyboardHeight()
accountModifier = accountModifier.padding(bottom = keyboardHeight)
} else {
accountModifier = accountModifier
.consumeWindowInsets(contentPadding)
.imePadding()
}

Column(
modifier = accountModifier
) {
Column(
modifier = Modifier.padding(vertical = LocalDimensions.current.spacing),
horizontalAlignment = Alignment.CenterHorizontally,
) {
SessionOutlinedTextField(
text = state.newMessageIdOrOns,
modifier = Modifier
.padding(horizontal = LocalDimensions.current.spacing),
contentDescription = "Session id input box",
placeholder = stringResource(R.string.accountIdOrOnsEnter),
onChange = callbacks::onChange,
onContinue = callbacks::onContinue,
error = state.error?.string(),
isTextErrorColor = state.isTextErrorColor
)

Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsSpacing))

BorderlessButtonWithIcon(
text = stringResource(R.string.messageNewDescription),
modifier = Modifier
.contentDescription(R.string.AccessibilityId_help_desk_link)
.padding(horizontal = LocalDimensions.current.mediumSpacing)
.fillMaxWidth(),
style = LocalType.current.small,
color = LocalColors.current.textSecondary,
iconRes = R.drawable.ic_circle_question_mark,
onClick = onHelp
)
}

Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing))
Spacer(Modifier.weight(2f))

PrimaryOutlineButton(
modifier = Modifier
.align(Alignment.CenterHorizontally)
.padding(horizontal = LocalDimensions.current.xlargeSpacing)
.padding(bottom = LocalDimensions.current.smallSpacing)
.fillMaxWidth()
.contentDescription(R.string.next),
enabled = state.isNextButtonEnabled,
onClick = callbacks::onContinue
) {
LoadingArcOr(state.loading) {
Text(stringResource(R.string.next))
}
}
}
}
}
}

@Composable
fun keyboardHeight(): MutableState<Dp> {
val view = LocalView.current
var keyboardHeight = remember { mutableStateOf(0.dp) }
val density = LocalDensity.current

DisposableEffect(view) {
val listener = ViewTreeObserver.OnGlobalLayoutListener {
val rect = Rect()
view.getWindowVisibleDisplayFrame(rect)
val screenHeight = view.rootView.height * PEEK_RATIO
val keypadHeightPx = max( screenHeight - rect.bottom, 0f)

keyboardHeight.value = with(density) { keypadHeightPx.toDp() }
}

view.viewTreeObserver.addOnGlobalLayoutListener(listener)
onDispose {
view.viewTreeObserver.removeOnGlobalLayoutListener(listener)
}
}

return keyboardHeight
}

@Preview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal class NewMessageViewModel @Inject constructor(
}

override fun onContinue() {
val idOrONS = state.value.newMessageIdOrOns
val idOrONS = state.value.newMessageIdOrOns.trim()

if (PublicKeyValidation.isValid(idOrONS, isPrefixRequired = false)) {
onUnvalidatedPublicKey(publicKey = idOrONS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.viewModels
import androidx.core.text.set
import androidx.core.text.toSpannable
import androidx.core.view.drawToBitmap
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.fragment.app.DialogFragment
Expand Down Expand Up @@ -165,19 +164,18 @@ import org.thoughtcrime.securesms.mms.VideoSlide
import org.thoughtcrime.securesms.permissions.Permissions
import org.thoughtcrime.securesms.reactions.ReactionsDialogFragment
import org.thoughtcrime.securesms.reactions.any.ReactWithAnyEmojiDialogFragment
import org.thoughtcrime.securesms.recoverypassword.RecoveryPasswordActivity
import org.thoughtcrime.securesms.showSessionDialog
import org.thoughtcrime.securesms.util.ActivityDispatcher
import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
import org.thoughtcrime.securesms.util.DateUtils
import org.thoughtcrime.securesms.util.MediaUtil
import org.thoughtcrime.securesms.util.NetworkUtils
import org.thoughtcrime.securesms.util.SaveAttachmentTask
import org.thoughtcrime.securesms.util.drawToBitmap
import org.thoughtcrime.securesms.util.isScrolledToBottom
import org.thoughtcrime.securesms.util.isScrolledToWithin30dpOfBottom
import org.thoughtcrime.securesms.util.push
import org.thoughtcrime.securesms.util.show
import org.thoughtcrime.securesms.util.start
import org.thoughtcrime.securesms.util.toPx
import java.lang.ref.WeakReference
import java.util.Locale
Expand Down Expand Up @@ -1589,8 +1587,15 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
val text = getMessageBody()
val userPublicKey = textSecurePreferences.getLocalNumber()
val isNoteToSelf = (recipient.isContactRecipient && recipient.address.toString() == userPublicKey)
if (text.contains(seed) && !isNoteToSelf && !hasPermissionToSendSeed) {
start<RecoveryPasswordActivity>()
if (seed in text && !isNoteToSelf && !hasPermissionToSendSeed) {
showSessionDialog {
title(R.string.dialog_send_seed_title)
text(R.string.dialog_send_seed_explanation)
button(R.string.dialog_send_seed_send_button_title) { sendTextOnlyMessage(true) }
cancelButton()
}

return null
}
// Create the message
val message = VisibleMessage().applyExpiryMode(viewModel.threadId)
Expand Down

This file was deleted.

Loading