mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-27 06:29:54 +00:00
Improve copy for unregistered users.
This commit is contained in:
committed by
Alex Hart
parent
e0bd60f87c
commit
bca346ec2f
@@ -1145,7 +1145,7 @@ class ConversationFragment :
|
||||
inputReadyState.isRequestingMember == true -> disabledInputView.showAsRequestingMember()
|
||||
inputReadyState.isAnnouncementGroup == true && inputReadyState.isAdmin == false -> disabledInputView.showAsAnnouncementGroupAdminsOnly()
|
||||
inputReadyState.conversationRecipient.isReleaseNotes -> disabledInputView.showAsReleaseNotesChannel(inputReadyState.conversationRecipient)
|
||||
inputReadyState.shouldShowInviteToSignal() -> disabledInputView.showAsInviteToSignal(requireContext(), inputReadyState.conversationRecipient)
|
||||
inputReadyState.shouldShowInviteToSignal() -> disabledInputView.showAsInviteToSignal(requireContext(), inputReadyState.conversationRecipient, inputReadyState.threadContainsSms)
|
||||
else -> inputDisabled = false
|
||||
}
|
||||
|
||||
|
||||
@@ -238,7 +238,8 @@ class ConversationViewModel(
|
||||
messageRequestState = messageRequestRepository.getMessageRequestState(recipient, threadId),
|
||||
groupRecord = groupRecord.orNull(),
|
||||
isClientExpired = SignalStore.misc().isClientDeprecated,
|
||||
isUnauthorized = TextSecurePreferences.isUnauthorizedReceived(ApplicationDependencies.getApplication())
|
||||
isUnauthorized = TextSecurePreferences.isUnauthorizedReceived(ApplicationDependencies.getApplication()),
|
||||
threadContainsSms = !recipient.isRegistered && !recipient.isPushGroup && !recipient.isSelf && messageRequestRepository.threadContainsSms(threadId)
|
||||
)
|
||||
}.doOnNext {
|
||||
hasMessageRequestStateSubject.onNext(it.messageRequestState)
|
||||
|
||||
@@ -127,15 +127,17 @@ class DisabledInputView @JvmOverloads constructor(
|
||||
)
|
||||
}
|
||||
|
||||
fun showAsInviteToSignal(context: Context, recipient: Recipient) {
|
||||
fun showAsInviteToSignal(context: Context, recipient: Recipient, threadContainsSms: Boolean) {
|
||||
inviteToSignal = show(
|
||||
existingView = inviteToSignal,
|
||||
create = { inflater.inflate(R.layout.conversation_activity_sms_export_stub, this, false) },
|
||||
bind = {
|
||||
findViewById<TextView>(R.id.export_sms_message).text = if (recipient.isMmsGroup) {
|
||||
context.getString(R.string.ConversationActivity__sms_messaging_is_no_longer_supported)
|
||||
} else {
|
||||
} else if (threadContainsSms) {
|
||||
context.getString(R.string.ConversationActivity__sms_messaging_is_no_longer_supported_in_signal_invite_s_to_to_signal_to_keep_the_conversation_here, recipient.getDisplayName(context))
|
||||
} else {
|
||||
context.getString(R.string.ConversationActivity__this_person_is_no_longer_using_signal)
|
||||
}
|
||||
|
||||
findViewById<MaterialButton>(R.id.export_sms_button).apply {
|
||||
|
||||
@@ -18,7 +18,8 @@ class InputReadyState(
|
||||
val messageRequestState: MessageRequestState,
|
||||
val groupRecord: GroupRecord?,
|
||||
val isClientExpired: Boolean,
|
||||
val isUnauthorized: Boolean
|
||||
val isUnauthorized: Boolean,
|
||||
val threadContainsSms: Boolean
|
||||
) {
|
||||
private val selfMemberLevel: GroupTable.MemberLevel? = groupRecord?.memberLevel(Recipient.self())
|
||||
|
||||
|
||||
@@ -4861,6 +4861,13 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
|
||||
return type
|
||||
}
|
||||
|
||||
fun threadContainsSms(threadId: Long): Boolean {
|
||||
return readableDatabase
|
||||
.exists(TABLE_NAME)
|
||||
.where(getInsecureMessageClause(threadId))
|
||||
.run()
|
||||
}
|
||||
|
||||
protected enum class ReceiptType(val columnName: String, val groupStatus: Int) {
|
||||
READ(HAS_READ_RECEIPT, GroupReceiptTable.STATUS_READ),
|
||||
DELIVERY(HAS_DELIVERY_RECEIPT, GroupReceiptTable.STATUS_DELIVERED),
|
||||
|
||||
@@ -150,6 +150,10 @@ public final class MessageRequestRepository {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean threadContainsSms(long threadId) {
|
||||
return SignalDatabase.messages().threadContainsSms(threadId);
|
||||
}
|
||||
|
||||
private boolean reportedAsSpam(long threadId) {
|
||||
return SignalDatabase.messages().hasReportSpamMessage(threadId) ||
|
||||
SignalDatabase.messages().getOutgoingSecureMessageCount(threadId) > 0;
|
||||
|
||||
@@ -426,6 +426,8 @@
|
||||
<string name="ConversationActivity__sms_messaging_is_no_longer_supported">SMS messaging is no longer supported in Signal.</string>
|
||||
<!-- Message shown when opening an SMS conversation with SMS disabled and there are no exported messages -->
|
||||
<string name="ConversationActivity__sms_messaging_is_no_longer_supported_in_signal_invite_s_to_to_signal_to_keep_the_conversation_here">SMS messaging is no longer supported in Signal. Invite %1$s to Signal to keep the conversation here.</string>
|
||||
<!-- Message shown when opening a conversation with an unregistered user who used to be on Signal -->
|
||||
<string name="ConversationActivity__this_person_is_no_longer_using_signal">This person is no longer using Signal. Invite them to Signal to keep the conversation here.</string>
|
||||
<!-- Action button shown when opening an SMS conversation with SMS disabled and there are no exported messages -->
|
||||
<string name="ConversationActivity__invite_to_signal">Invite to Signal</string>
|
||||
<!-- Snackbar message shown after dismissing the full screen sms export megaphone indicating we\'ll do it again soon -->
|
||||
|
||||
Reference in New Issue
Block a user