mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Update unsupported message UI.
This commit is contained in:
@@ -346,5 +346,7 @@ class V2ConversationItemShapeTest {
|
|||||||
override fun onDisplayMediaNoLongerAvailableSheet() = Unit
|
override fun onDisplayMediaNoLongerAvailableSheet() = Unit
|
||||||
|
|
||||||
override fun onShowUnverifiedProfileSheet(forGroup: Boolean) = Unit
|
override fun onShowUnverifiedProfileSheet(forGroup: Boolean) = Unit
|
||||||
|
|
||||||
|
override fun onUpdateSignalClicked() = Unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -332,5 +332,9 @@ class InternalConversationTestFragment : Fragment(R.layout.conversation_test_fra
|
|||||||
override fun onShowUnverifiedProfileSheet(forGroup: Boolean) {
|
override fun onShowUnverifiedProfileSheet(forGroup: Boolean) {
|
||||||
Toast.makeText(requireContext(), "Can't touch this.", Toast.LENGTH_SHORT).show()
|
Toast.makeText(requireContext(), "Can't touch this.", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onUpdateSignalClicked() {
|
||||||
|
Toast.makeText(requireContext(), "Can't touch this.", Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,5 +142,6 @@ public interface BindableConversationItem extends Unbindable, GiphyMp4Playable,
|
|||||||
void onPaymentTombstoneClicked();
|
void onPaymentTombstoneClicked();
|
||||||
void onDisplayMediaNoLongerAvailableSheet();
|
void onDisplayMediaNoLongerAvailableSheet();
|
||||||
void onShowUnverifiedProfileSheet(boolean forGroup);
|
void onShowUnverifiedProfileSheet(boolean forGroup);
|
||||||
|
void onUpdateSignalClicked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -634,6 +634,16 @@ public final class ConversationUpdateItem extends FrameLayout
|
|||||||
passthroughClickListener.onClick(v);
|
passthroughClickListener.onClick(v);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else if (conversationMessage.getMessageRecord().isUnsupported()) {
|
||||||
|
actionButton.setText(R.string.ConversationFragment__update_build);
|
||||||
|
actionButton.setVisibility(VISIBLE);
|
||||||
|
actionButton.setOnClickListener(v -> {
|
||||||
|
if (batchSelected.isEmpty() && eventListener != null) {
|
||||||
|
eventListener.onUpdateSignalClicked();
|
||||||
|
} else {
|
||||||
|
passthroughClickListener.onClick(v);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
actionButton.setVisibility(GONE);
|
actionButton.setVisibility(GONE);
|
||||||
actionButton.setOnClickListener(null);
|
actionButton.setOnClickListener(null);
|
||||||
|
|||||||
@@ -3040,6 +3040,10 @@ class ConversationFragment :
|
|||||||
UnverifiedProfileNameBottomSheet.show(parentFragmentManager, forGroup)
|
UnverifiedProfileNameBottomSheet.show(parentFragmentManager, forGroup)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onUpdateSignalClicked() {
|
||||||
|
PlayStoreUtil.openPlayStoreOrOurApkDownloadPage(requireContext())
|
||||||
|
}
|
||||||
|
|
||||||
override fun onJoinGroupCallClicked() {
|
override fun onJoinGroupCallClicked() {
|
||||||
val activity = activity ?: return
|
val activity = activity ?: return
|
||||||
val recipient = viewModel.recipientSnapshot ?: return
|
val recipient = viewModel.recipientSnapshot ?: return
|
||||||
|
|||||||
@@ -256,4 +256,8 @@ public abstract class DisplayRecord {
|
|||||||
public boolean isUnblocked() {
|
public boolean isUnblocked() {
|
||||||
return MessageTypes.isUnblocked(type);
|
return MessageTypes.isUnblocked(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isUnsupported() {
|
||||||
|
return MessageTypes.isUnsupportedMessageType(type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -291,6 +291,8 @@ public abstract class MessageRecord extends DisplayRecord {
|
|||||||
return staticUpdateDescription(context.getString(isGroupV2() ? R.string.MessageRecord_you_blocked_this_group : R.string.MessageRecord_you_blocked_this_person), Glyph.BLOCK);
|
return staticUpdateDescription(context.getString(isGroupV2() ? R.string.MessageRecord_you_blocked_this_group : R.string.MessageRecord_you_blocked_this_person), Glyph.BLOCK);
|
||||||
} else if (isUnblocked()) {
|
} else if (isUnblocked()) {
|
||||||
return staticUpdateDescription(context.getString(isGroupV2() ? R.string.MessageRecord_you_unblocked_this_group : R.string.MessageRecord_you_unblocked_this_person) , Glyph.THREAD);
|
return staticUpdateDescription(context.getString(isGroupV2() ? R.string.MessageRecord_you_unblocked_this_group : R.string.MessageRecord_you_unblocked_this_person) , Glyph.THREAD);
|
||||||
|
} else if (isUnsupported()) {
|
||||||
|
return staticUpdateDescription(context.getString(R.string.MessageRecord_unsupported_feature, getFromRecipient().getDisplayName(context)), Glyph.ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -730,7 +732,7 @@ public abstract class MessageRecord extends DisplayRecord {
|
|||||||
isProfileChange() || isGroupV1MigrationEvent() || isChatSessionRefresh() || isBadDecryptType() ||
|
isProfileChange() || isGroupV1MigrationEvent() || isChatSessionRefresh() || isBadDecryptType() ||
|
||||||
isChangeNumber() || isReleaseChannelDonationRequest() || isThreadMergeEventType() || isSmsExportType() || isSessionSwitchoverEventType() ||
|
isChangeNumber() || isReleaseChannelDonationRequest() || isThreadMergeEventType() || isSmsExportType() || isSessionSwitchoverEventType() ||
|
||||||
isPaymentsRequestToActivate() || isPaymentsActivated() || isReportedSpam() || isMessageRequestAccepted() ||
|
isPaymentsRequestToActivate() || isPaymentsActivated() || isReportedSpam() || isMessageRequestAccepted() ||
|
||||||
isBlocked() || isUnblocked();
|
isBlocked() || isUnblocked() || isUnsupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMediaPending() {
|
public boolean isMediaPending() {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.net.Uri
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
@@ -391,6 +392,10 @@ class MessageDetailsFragment : FullScreenDialogFragment(), MessageDetailsAdapter
|
|||||||
Log.w(TAG, "Not yet implemented!", Exception())
|
Log.w(TAG, "Not yet implemented!", Exception())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onUpdateSignalClicked() {
|
||||||
|
Toast.makeText(requireContext(), "Can't touch this.", Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
|
|
||||||
interface Callback {
|
interface Callback {
|
||||||
fun onMessageDetailsFragmentDismissed()
|
fun onMessageDetailsFragmentDismissed()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import org.thoughtcrime.securesms.jobs.SendRetryReceiptJob
|
|||||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||||
import org.thoughtcrime.securesms.logsubmit.SubmitDebugLogActivity
|
import org.thoughtcrime.securesms.logsubmit.SubmitDebugLogActivity
|
||||||
import org.thoughtcrime.securesms.messages.MessageDecryptor.FollowUpOperation
|
import org.thoughtcrime.securesms.messages.MessageDecryptor.FollowUpOperation
|
||||||
|
import org.thoughtcrime.securesms.messages.SignalServiceProtoUtil.hasGroupContext
|
||||||
import org.thoughtcrime.securesms.messages.protocol.BufferedProtocolStore
|
import org.thoughtcrime.securesms.messages.protocol.BufferedProtocolStore
|
||||||
import org.thoughtcrime.securesms.notifications.NotificationChannels
|
import org.thoughtcrime.securesms.notifications.NotificationChannels
|
||||||
import org.thoughtcrime.securesms.notifications.NotificationIds
|
import org.thoughtcrime.securesms.notifications.NotificationIds
|
||||||
@@ -528,10 +529,15 @@ object MessageDecryptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun SignalServiceCipherResult.toErrorMetadata(): ErrorMetadata {
|
private fun SignalServiceCipherResult.toErrorMetadata(): ErrorMetadata {
|
||||||
|
val groupId = if (this.content.dataMessage.hasGroupContext) {
|
||||||
|
GroupId.v2(GroupMasterKey(this.content.dataMessage!!.groupV2!!.masterKey!!.toByteArray()))
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
return ErrorMetadata(
|
return ErrorMetadata(
|
||||||
sender = this.metadata.sourceServiceId.toString(),
|
sender = this.metadata.sourceServiceId.toString(),
|
||||||
senderDevice = this.metadata.sourceDeviceId,
|
senderDevice = this.metadata.sourceDeviceId,
|
||||||
groupId = null
|
groupId = groupId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2115,6 +2115,8 @@
|
|||||||
<string name="MessageRecord_you_blocked_this_group">You blocked this group</string>
|
<string name="MessageRecord_you_blocked_this_group">You blocked this group</string>
|
||||||
<!-- Update message shown in chat after you unblock a group -->
|
<!-- Update message shown in chat after you unblock a group -->
|
||||||
<string name="MessageRecord_you_unblocked_this_group">You unblocked this group</string>
|
<string name="MessageRecord_you_unblocked_this_group">You unblocked this group</string>
|
||||||
|
<!-- Update message shown when you receive a message that cannot be processed because your Signal version is too old. %1$s is the sender\'s name -->
|
||||||
|
<string name="MessageRecord_unsupported_feature">%1$s sent you a message that can\'t be processed or displayed because it uses a new Signal feature.</string>
|
||||||
|
|
||||||
<!-- MessageRequestBottomView -->
|
<!-- MessageRequestBottomView -->
|
||||||
<string name="MessageRequestBottomView_accept">Accept</string>
|
<string name="MessageRequestBottomView_accept">Accept</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user