mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Add in-chat payment activation requests.
Co-authored-by: Varsha <varsha@mobilecoin.com>
This commit is contained in:
@@ -104,6 +104,7 @@ public final class FeatureFlags {
|
||||
private static final String HIDE_CONTACTS = "android.hide.contacts";
|
||||
private static final String SMS_EXPORT_MEGAPHONE_DELAY_DAYS = "android.smsExport.megaphoneDelayDays.2";
|
||||
public static final String CREDIT_CARD_PAYMENTS = "android.credit.card.payments";
|
||||
private static final String PAYMENTS_REQUEST_ACTIVATE_FLOW = "android.payments.requestActivateFlow";
|
||||
|
||||
/**
|
||||
* We will only store remote values for flags in this set. If you want a flag to be controllable
|
||||
@@ -159,7 +160,8 @@ public final class FeatureFlags {
|
||||
STORIES_LOCALE,
|
||||
HIDE_CONTACTS,
|
||||
SMS_EXPORT_MEGAPHONE_DELAY_DAYS,
|
||||
CREDIT_CARD_PAYMENTS
|
||||
CREDIT_CARD_PAYMENTS,
|
||||
PAYMENTS_REQUEST_ACTIVATE_FLOW
|
||||
);
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -222,7 +224,8 @@ public final class FeatureFlags {
|
||||
RECIPIENT_MERGE_V2,
|
||||
STORIES,
|
||||
SMS_EXPORT_MEGAPHONE_DELAY_DAYS,
|
||||
CREDIT_CARD_PAYMENTS
|
||||
CREDIT_CARD_PAYMENTS,
|
||||
PAYMENTS_REQUEST_ACTIVATE_FLOW
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -570,6 +573,11 @@ public final class FeatureFlags {
|
||||
return getBoolean(CREDIT_CARD_PAYMENTS, Environment.IS_STAGING);
|
||||
}
|
||||
|
||||
/** Whether client supports sending a request to another to activate payments */
|
||||
public static boolean paymentsRequestActivateFlow() {
|
||||
return getBoolean(PAYMENTS_REQUEST_ACTIVATE_FLOW, false);
|
||||
}
|
||||
|
||||
/** Only for rendering debug info. */
|
||||
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
|
||||
return new TreeMap<>(REMOTE_VALUES);
|
||||
|
||||
@@ -44,6 +44,12 @@ fun MessageRecord.hasThumbnail(): Boolean =
|
||||
fun MessageRecord.isStoryReaction(): Boolean =
|
||||
isMms && MmsSmsColumns.Types.isStoryReaction((this as MmsMessageRecord).type)
|
||||
|
||||
fun MessageRecord.isPaymentActivationRequest(): Boolean =
|
||||
isMms && MmsSmsColumns.Types.isRequestToActivatePayments((this as MmsMessageRecord).type)
|
||||
|
||||
fun MessageRecord.isPaymentsActivated(): Boolean =
|
||||
isMms && MmsSmsColumns.Types.isPaymentsActivated((this as MmsMessageRecord).type)
|
||||
|
||||
fun MessageRecord.isBorderless(context: Context): Boolean {
|
||||
return isCaptionlessMms(context) &&
|
||||
hasThumbnail() &&
|
||||
|
||||
Reference in New Issue
Block a user