Inline gift receive flag.

main
Alex Hart 2022-11-30 09:17:58 -04:00 zatwierdzone przez Cody Henthorne
rodzic 031d7b9cb0
commit b70b4fac91
3 zmienionych plików z 3 dodań i 17 usunięć

Wyświetl plik

@ -16,12 +16,13 @@ public final class AppCapabilities {
private static final boolean SENDER_KEY = true;
private static final boolean CHANGE_NUMBER = true;
private static final boolean STORIES = true;
private static final boolean GIFT_BADGES = true;
/**
* @param storageCapable Whether or not the user can use storage service. This is another way of
* asking if the user has set a Signal PIN or not.
*/
public static AccountAttributes.Capabilities getCapabilities(boolean storageCapable) {
return new AccountAttributes.Capabilities(UUID_CAPABLE, GV2_CAPABLE, storageCapable, GV1_MIGRATION, SENDER_KEY, ANNOUNCEMENT_GROUPS, CHANGE_NUMBER, STORIES, FeatureFlags.giftBadgeReceiveSupport(), FeatureFlags.phoneNumberPrivacy());
return new AccountAttributes.Capabilities(UUID_CAPABLE, GV2_CAPABLE, storageCapable, GV1_MIGRATION, SENDER_KEY, ANNOUNCEMENT_GROUPS, CHANGE_NUMBER, STORIES, GIFT_BADGES, FeatureFlags.phoneNumberPrivacy());
}
}

Wyświetl plik

@ -1807,11 +1807,6 @@ public final class MessageContentProcessor {
{
log(message.getTimestamp(), "Gift message.");
if (!FeatureFlags.giftBadgeReceiveSupport()) {
warn(message.getTimestamp(), "Dropping unsupported gift badge message.");
return null;
}
notifyTypingStoppedFromIncomingMessage(senderRecipient, threadRecipient, content.getSenderDevice());
Optional<InsertResult> insertResult;

Wyświetl plik

@ -90,7 +90,6 @@ public final class FeatureFlags {
private static final String PHONE_NUMBER_PRIVACY = "android.pnp";
private static final String USE_FCM_FOREGROUND_SERVICE = "android.useFcmForegroundService.3";
private static final String STORIES_AUTO_DOWNLOAD_MAXIMUM = "android.stories.autoDownloadMaximum";
private static final String GIFT_BADGE_RECEIVE_SUPPORT = "android.giftBadges.receiving";
private static final String GIFT_BADGE_SEND_SUPPORT = "android.giftBadges.sending.3";
private static final String TELECOM_MANUFACTURER_ALLOWLIST = "android.calling.telecomAllowList";
private static final String TELECOM_MODEL_BLOCKLIST = "android.calling.telecomModelBlockList";
@ -150,7 +149,6 @@ public final class FeatureFlags {
PAYMENTS_COUNTRY_BLOCKLIST,
USE_FCM_FOREGROUND_SERVICE,
STORIES_AUTO_DOWNLOAD_MAXIMUM,
GIFT_BADGE_RECEIVE_SUPPORT,
GIFT_BADGE_SEND_SUPPORT,
TELECOM_MANUFACTURER_ALLOWLIST,
TELECOM_MODEL_BLOCKLIST,
@ -257,7 +255,6 @@ public final class FeatureFlags {
*/
private static final Map<String, OnFlagChange> FLAG_CHANGE_LISTENERS = new HashMap<String, OnFlagChange>() {{
put(MESSAGE_PROCESSOR_ALARM_INTERVAL, change -> MessageProcessReceiver.startOrUpdateAlarm(ApplicationDependencies.getApplication()));
put(GIFT_BADGE_RECEIVE_SUPPORT, change -> ApplicationDependencies.getJobManager().startChain(new RefreshAttributesJob()).then(new RefreshOwnProfileJob()).enqueue());
}};
private static final Map<String, Object> REMOTE_VALUES = new TreeMap<>();
@ -512,18 +509,11 @@ public final class FeatureFlags {
return getInteger(STORIES_AUTO_DOWNLOAD_MAXIMUM, 2);
}
/**
* Whether or not receiving Gifting Badges should be available on this client.
*/
public static boolean giftBadgeReceiveSupport() {
return getBoolean(GIFT_BADGE_RECEIVE_SUPPORT, Environment.IS_STAGING);
}
/**
* Whether or not sending Gifting Badges should be available on this client.
*/
public static boolean giftBadgeSendSupport() {
return giftBadgeReceiveSupport() && getBoolean(GIFT_BADGE_SEND_SUPPORT, Environment.IS_STAGING);
return getBoolean(GIFT_BADGE_SEND_SUPPORT, Environment.IS_STAGING);
}
/**