mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 20:28:33 +00:00
Remove mentions feature flag.
This commit is contained in:
parent
d04e4606d2
commit
b46589cd14
@ -100,7 +100,7 @@ public class ComposeText extends EmojiEditText {
|
|||||||
protected void onSelectionChanged(int selectionStart, int selectionEnd) {
|
protected void onSelectionChanged(int selectionStart, int selectionEnd) {
|
||||||
super.onSelectionChanged(selectionStart, selectionEnd);
|
super.onSelectionChanged(selectionStart, selectionEnd);
|
||||||
|
|
||||||
if (FeatureFlags.mentions() && getText() != null) {
|
if (getText() != null) {
|
||||||
boolean selectionChanged = changeSelectionForPartialMentions(getText(), selectionStart, selectionEnd);
|
boolean selectionChanged = changeSelectionForPartialMentions(getText(), selectionStart, selectionEnd);
|
||||||
if (selectionChanged) {
|
if (selectionChanged) {
|
||||||
return;
|
return;
|
||||||
@ -192,9 +192,7 @@ public class ComposeText extends EmojiEditText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setMentionValidator(@Nullable MentionValidatorWatcher.MentionValidator mentionValidator) {
|
public void setMentionValidator(@Nullable MentionValidatorWatcher.MentionValidator mentionValidator) {
|
||||||
if (FeatureFlags.mentions()) {
|
mentionValidatorWatcher.setMentionValidator(mentionValidator);
|
||||||
mentionValidatorWatcher.setMentionValidator(mentionValidator);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isLandscape() {
|
private boolean isLandscape() {
|
||||||
@ -261,11 +259,9 @@ public class ComposeText extends EmojiEditText {
|
|||||||
|
|
||||||
mentionRendererDelegate = new MentionRendererDelegate(getContext(), ThemeUtil.getThemedColor(getContext(), R.attr.conversation_mention_background_color));
|
mentionRendererDelegate = new MentionRendererDelegate(getContext(), ThemeUtil.getThemedColor(getContext(), R.attr.conversation_mention_background_color));
|
||||||
|
|
||||||
if (FeatureFlags.mentions()) {
|
addTextChangedListener(new MentionDeleter());
|
||||||
addTextChangedListener(new MentionDeleter());
|
mentionValidatorWatcher = new MentionValidatorWatcher();
|
||||||
mentionValidatorWatcher = new MentionValidatorWatcher();
|
addTextChangedListener(mentionValidatorWatcher);
|
||||||
addTextChangedListener(mentionValidatorWatcher);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean changeSelectionForPartialMentions(@NonNull Spanned spanned, int selectionStart, int selectionEnd) {
|
private boolean changeSelectionForPartialMentions(@NonNull Spanned spanned, int selectionStart, int selectionEnd) {
|
||||||
|
@ -442,7 +442,7 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
|||||||
initializeStickerObserver();
|
initializeStickerObserver();
|
||||||
initializeViewModel();
|
initializeViewModel();
|
||||||
initializeGroupViewModel();
|
initializeGroupViewModel();
|
||||||
if (FeatureFlags.mentions()) initializeMentionsViewModel();
|
initializeMentionsViewModel();
|
||||||
initializeEnabledCheck();
|
initializeEnabledCheck();
|
||||||
initializeSecurity(recipient.get().isRegistered(), isDefaultSms).addListener(new AssertedSuccessListener<Boolean>() {
|
initializeSecurity(recipient.get().isRegistered(), isDefaultSms).addListener(new AssertedSuccessListener<Boolean>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -366,7 +366,7 @@ public class ManageGroupFragment extends LoggingFragment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
mentionsRow.setVisibility(FeatureFlags.mentions() && groupId.isV2() ? View.VISIBLE : View.GONE);
|
mentionsRow.setVisibility(groupId.isV2() ? View.VISIBLE : View.GONE);
|
||||||
mentionsRow.setOnClickListener(v -> viewModel.handleMentionNotificationSelection());
|
mentionsRow.setOnClickListener(v -> viewModel.handleMentionNotificationSelection());
|
||||||
viewModel.getMentionSetting().observe(getViewLifecycleOwner(), value -> mentionsValue.setText(value));
|
viewModel.getMentionSetting().observe(getViewLifecycleOwner(), value -> mentionsValue.setText(value));
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ public class MediaSendActivity extends PassphraseRequiredActivity implements Med
|
|||||||
emojiToggle.setOnClickListener(this::onEmojiToggleClicked);
|
emojiToggle.setOnClickListener(this::onEmojiToggleClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FeatureFlags.mentions()) initializeMentionsViewModel();
|
initializeMentionsViewModel();
|
||||||
initViewModel();
|
initViewModel();
|
||||||
|
|
||||||
revealButton.setOnClickListener(v -> viewModel.onRevealButtonToggled());
|
revealButton.setOnClickListener(v -> viewModel.onRevealButtonToggled());
|
||||||
|
@ -265,8 +265,7 @@ public class DefaultMessageNotifier implements MessageNotifier {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FeatureFlags.mentions() &&
|
return recipient.isPushV2Group() &&
|
||||||
recipient.isPushV2Group() &&
|
|
||||||
recipient.getMentionSetting() == RecipientDatabase.MentionSetting.ALWAYS_NOTIFY &&
|
recipient.getMentionSetting() == RecipientDatabase.MentionSetting.ALWAYS_NOTIFY &&
|
||||||
DatabaseFactory.getMmsDatabase(context).getUnreadMentionCount(threadId) > 0;
|
DatabaseFactory.getMmsDatabase(context).getUnreadMentionCount(threadId) > 0;
|
||||||
}
|
}
|
||||||
@ -556,7 +555,7 @@ public class DefaultMessageNotifier implements MessageNotifier {
|
|||||||
if (threadRecipients != null && threadRecipients.isMuted()) {
|
if (threadRecipients != null && threadRecipients.isMuted()) {
|
||||||
boolean mentionsOverrideMute = threadRecipients.getMentionSetting() == RecipientDatabase.MentionSetting.ALWAYS_NOTIFY;
|
boolean mentionsOverrideMute = threadRecipients.getMentionSetting() == RecipientDatabase.MentionSetting.ALWAYS_NOTIFY;
|
||||||
|
|
||||||
includeMessage = FeatureFlags.mentions() && mentionsOverrideMute && record.hasSelfMention();
|
includeMessage = mentionsOverrideMute && record.hasSelfMention();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (threadRecipients == null || includeMessage) {
|
if (threadRecipients == null || includeMessage) {
|
||||||
|
@ -52,7 +52,6 @@ public final class FeatureFlags {
|
|||||||
private static final String GROUPS_V2_LINKS_VERSION = "android.groupsv2.manageGroupLinksVersion";
|
private static final String GROUPS_V2_LINKS_VERSION = "android.groupsv2.manageGroupLinksVersion";
|
||||||
private static final String GROUPS_V2_CAPACITY = "global.groupsv2.maxGroupSize";
|
private static final String GROUPS_V2_CAPACITY = "global.groupsv2.maxGroupSize";
|
||||||
private static final String INTERNAL_USER = "android.internalUser";
|
private static final String INTERNAL_USER = "android.internalUser";
|
||||||
private static final String MENTIONS = "android.mentions";
|
|
||||||
private static final String VERIFY_V2 = "android.verifyV2";
|
private static final String VERIFY_V2 = "android.verifyV2";
|
||||||
private static final String PHONE_NUMBER_PRIVACY_VERSION = "android.phoneNumberPrivacyVersion";
|
private static final String PHONE_NUMBER_PRIVACY_VERSION = "android.phoneNumberPrivacyVersion";
|
||||||
private static final String CLIENT_EXPIRATION = "android.clientExpiration";
|
private static final String CLIENT_EXPIRATION = "android.clientExpiration";
|
||||||
@ -70,7 +69,6 @@ public final class FeatureFlags {
|
|||||||
GROUPS_V2_LINKS_VERSION,
|
GROUPS_V2_LINKS_VERSION,
|
||||||
INTERNAL_USER,
|
INTERNAL_USER,
|
||||||
USERNAMES,
|
USERNAMES,
|
||||||
MENTIONS,
|
|
||||||
VERIFY_V2,
|
VERIFY_V2,
|
||||||
CLIENT_EXPIRATION,
|
CLIENT_EXPIRATION,
|
||||||
RESEARCH_MEGAPHONE_1,
|
RESEARCH_MEGAPHONE_1,
|
||||||
@ -213,11 +211,6 @@ public final class FeatureFlags {
|
|||||||
return getBoolean(INTERNAL_USER, false);
|
return getBoolean(INTERNAL_USER, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Whether or not we allow mentions send support in groups. */
|
|
||||||
public static boolean mentions() {
|
|
||||||
return getBoolean(MENTIONS, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Whether or not to use the UUID in verification codes. */
|
/** Whether or not to use the UUID in verification codes. */
|
||||||
public static boolean verifyV2() {
|
public static boolean verifyV2() {
|
||||||
return getBoolean(VERIFY_V2, false);
|
return getBoolean(VERIFY_V2, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user