From 5ede4a57761f4952e09bddc73a892c31cabbfd64 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 7 Jun 2024 17:42:44 +0930 Subject: [PATCH] Rename sendInvitationToUseSession --- .../securesms/conversation/start/InviteFriendFragment.kt | 4 ++-- .../thoughtcrime/securesms/preferences/SettingsActivity.kt | 6 ++---- .../java/org/thoughtcrime/securesms/preferences/Util.kt | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/start/InviteFriendFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/start/InviteFriendFragment.kt index a120adf4b7..992a6604eb 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/start/InviteFriendFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/start/InviteFriendFragment.kt @@ -31,7 +31,7 @@ import dagger.hilt.android.AndroidEntryPoint import network.loki.messenger.R import org.session.libsession.utilities.TextSecurePreferences import org.thoughtcrime.securesms.preferences.copyPublicKey -import org.thoughtcrime.securesms.preferences.sendInvitation +import org.thoughtcrime.securesms.preferences.sendInvitationToUseSession import org.thoughtcrime.securesms.ui.AppTheme import org.thoughtcrime.securesms.ui.classicDarkColors import org.thoughtcrime.securesms.ui.components.AppBar @@ -56,7 +56,7 @@ class InviteFriendFragment : Fragment() { onBack = { delegate.onDialogBackPressed() }, onClose = { delegate.onDialogClosePressed() }, copyPublicKey = requireContext()::copyPublicKey, - sendInvitation = requireContext()::sendInvitation, + sendInvitation = requireContext()::sendInvitationToUseSession, ) } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/SettingsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/SettingsActivity.kt index 5b3ec6cf0f..454c123dbd 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/SettingsActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/SettingsActivity.kt @@ -17,7 +17,6 @@ import android.view.View import android.view.inputmethod.EditorInfo import android.view.inputmethod.InputMethodManager import android.widget.Toast -import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -82,7 +81,6 @@ import org.thoughtcrime.securesms.ui.ItemButton import org.thoughtcrime.securesms.ui.ItemButtonWithDrawable import org.thoughtcrime.securesms.ui.components.OutlineButton import org.thoughtcrime.securesms.ui.components.OutlineTemporaryStateButton -import org.thoughtcrime.securesms.ui.components.TemporaryStateButton import org.thoughtcrime.securesms.ui.contentDescription import org.thoughtcrime.securesms.ui.destructiveButtonColors import org.thoughtcrime.securesms.util.BitmapDecodingException @@ -397,7 +395,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() { ) { OutlineButton( modifier = Modifier.weight(1f), - onClick = { sendInvitation() } + onClick = { sendInvitationToUseSession() } ) { Text(stringResource(R.string.share)) } @@ -433,7 +431,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() { Divider() ItemButton(R.string.activity_settings_message_appearance_button_title, icon = R.drawable.ic_appearance, contentDescription = R.string.AccessibilityId_appearance) { show() } Divider() - ItemButton(R.string.activity_settings_invite_button_title, icon = R.drawable.ic_invite_friend, contentDescription = R.string.AccessibilityId_invite_friend) { sendInvitation() } + ItemButton(R.string.activity_settings_invite_button_title, icon = R.drawable.ic_invite_friend, contentDescription = R.string.AccessibilityId_invite_friend) { sendInvitationToUseSession() } Divider() if (!prefs.getHidePassword()) { ItemButton(R.string.sessionRecoveryPassword, icon = R.drawable.ic_recovery_phrase, contentDescription = R.string.AccessibilityId_recovery_password_menu_item) { show() } diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/Util.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/Util.kt index 24c5097e07..78d215c070 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/Util.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/Util.kt @@ -8,14 +8,14 @@ import android.widget.Toast import network.loki.messenger.R import org.session.libsession.utilities.TextSecurePreferences -fun Context.sendInvitation() { +fun Context.sendInvitationToUseSession() { Intent().apply { action = Intent.ACTION_SEND putExtra( Intent.EXTRA_TEXT, getString( R.string.accountIdShare, - TextSecurePreferences.getLocalNumber(this@sendInvitation) + TextSecurePreferences.getLocalNumber(this@sendInvitationToUseSession) ) ) type = "text/plain"