mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-27 12:15:50 +01:00
Remove Message Requests feature flag.
This commit is contained in:
committed by
Greyson Parrelli
parent
f2fe81d9b5
commit
3d7cffef2b
@@ -404,7 +404,7 @@ public class Recipient {
|
||||
List<String> names = new LinkedList<>();
|
||||
|
||||
for (Recipient recipient : participants) {
|
||||
names.add(recipient.toShortString(context));
|
||||
names.add(recipient.getDisplayName(context));
|
||||
}
|
||||
|
||||
return Util.join(names, ", ");
|
||||
@@ -413,15 +413,6 @@ public class Recipient {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO [UUID] -- Remove once UUID Feature Flag is removed
|
||||
*/
|
||||
@Deprecated
|
||||
public @NonNull String toShortString(@NonNull Context context) {
|
||||
if (FeatureFlags.profileDisplay()) return getDisplayName(context);
|
||||
else return Optional.fromNullable(getName(context)).or(getSmsAddress()).or("");
|
||||
}
|
||||
|
||||
/**
|
||||
* False iff it {@link #getDisplayName} would fall back to e164, email or unknown.
|
||||
*/
|
||||
@@ -600,11 +591,6 @@ public class Recipient {
|
||||
return profileName;
|
||||
}
|
||||
|
||||
public @Nullable String getCustomLabel() {
|
||||
if (FeatureFlags.profileDisplay()) throw new AssertionError("This method should never be called if PROFILE_DISPLAY is enabled.");
|
||||
return customLabel;
|
||||
}
|
||||
|
||||
public @Nullable String getProfileAvatar() {
|
||||
return profileAvatar;
|
||||
}
|
||||
|
||||
@@ -98,10 +98,7 @@ public class RecipientUtil {
|
||||
DatabaseFactory.getRecipientDatabase(context).setBlocked(recipient.getId(), false);
|
||||
ApplicationDependencies.getJobManager().add(new MultiDeviceBlockedUpdateJob());
|
||||
StorageSyncHelper.scheduleSyncForDataChange();
|
||||
|
||||
if (FeatureFlags.messageRequests()) {
|
||||
ApplicationDependencies.getJobManager().add(MultiDeviceMessageRequestResponseJob.forAccept(recipient.getId()));
|
||||
}
|
||||
ApplicationDependencies.getJobManager().add(MultiDeviceMessageRequestResponseJob.forAccept(recipient.getId()));
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
@@ -127,7 +124,7 @@ public class RecipientUtil {
|
||||
*/
|
||||
@WorkerThread
|
||||
public static boolean isMessageRequestAccepted(@NonNull Context context, long threadId) {
|
||||
if (!FeatureFlags.messageRequests() || threadId < 0) {
|
||||
if (threadId < 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -146,7 +143,7 @@ public class RecipientUtil {
|
||||
*/
|
||||
@WorkerThread
|
||||
public static boolean isMessageRequestAccepted(@NonNull Context context, @Nullable Recipient threadRecipient) {
|
||||
if (!FeatureFlags.messageRequests() || threadRecipient == null) {
|
||||
if (threadRecipient == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -159,20 +156,12 @@ public class RecipientUtil {
|
||||
*/
|
||||
@WorkerThread
|
||||
public static boolean isPreMessageRequestThread(@NonNull Context context, long threadId) {
|
||||
if (!FeatureFlags.messageRequests()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
long beforeTime = SignalStore.misc().getMessageRequestEnableTime();
|
||||
return DatabaseFactory.getMmsSmsDatabase(context).getConversationCount(threadId, beforeTime) > 0;
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
public static void shareProfileIfFirstSecureMessage(@NonNull Context context, @NonNull Recipient recipient) {
|
||||
if (!FeatureFlags.messageRequests()) {
|
||||
return;
|
||||
}
|
||||
|
||||
long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdIfExistsFor(recipient);
|
||||
|
||||
if (isPreMessageRequestThread(context, threadId)) {
|
||||
|
||||
@@ -114,7 +114,7 @@ final class RecipientDialogViewModel extends ViewModel {
|
||||
|
||||
void onMakeGroupAdminClicked(@NonNull Activity activity) {
|
||||
new AlertDialog.Builder(activity)
|
||||
.setMessage(context.getString(R.string.RecipientBottomSheet_s_will_be_able_to_edit_group, Objects.requireNonNull(recipient.getValue()).toShortString(context)))
|
||||
.setMessage(context.getString(R.string.RecipientBottomSheet_s_will_be_able_to_edit_group, Objects.requireNonNull(recipient.getValue()).getDisplayName(context)))
|
||||
.setPositiveButton(R.string.RecipientBottomSheet_make_group_admin,
|
||||
(dialog, which) -> {
|
||||
adminActionBusy.setValue(true);
|
||||
@@ -132,7 +132,7 @@ final class RecipientDialogViewModel extends ViewModel {
|
||||
|
||||
void onRemoveGroupAdminClicked(@NonNull Activity activity) {
|
||||
new AlertDialog.Builder(activity)
|
||||
.setMessage(context.getString(R.string.RecipientBottomSheet_remove_s_as_group_admin, Objects.requireNonNull(recipient.getValue()).toShortString(context)))
|
||||
.setMessage(context.getString(R.string.RecipientBottomSheet_remove_s_as_group_admin, Objects.requireNonNull(recipient.getValue()).getDisplayName(context)))
|
||||
.setPositiveButton(R.string.RecipientBottomSheet_remove_as_admin,
|
||||
(dialog, which) -> {
|
||||
adminActionBusy.setValue(true);
|
||||
@@ -151,7 +151,7 @@ final class RecipientDialogViewModel extends ViewModel {
|
||||
void onRemoveFromGroupClicked(@NonNull Activity activity, @NonNull Runnable onSuccess) {
|
||||
recipientDialogRepository.getGroupName(title ->
|
||||
new AlertDialog.Builder(activity)
|
||||
.setMessage(context.getString(R.string.RecipientBottomSheet_remove_s_from_s, Objects.requireNonNull(recipient.getValue()).toShortString(context), title))
|
||||
.setMessage(context.getString(R.string.RecipientBottomSheet_remove_s_from_s, Objects.requireNonNull(recipient.getValue()).getDisplayName(context), title))
|
||||
.setPositiveButton(R.string.RecipientBottomSheet_remove,
|
||||
(dialog, which) -> {
|
||||
adminActionBusy.setValue(true);
|
||||
|
||||
Reference in New Issue
Block a user