Skip to content

Commit

Permalink
Made view-once a non-sticky setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Jan 7, 2020
1 parent d2d450a commit c346f32
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
Expand Up @@ -194,7 +194,7 @@ void onImageEditorStarted() {
buttonState = (recipient != null) ? ButtonState.SEND : ButtonState.CONTINUE;

if (viewOnceState == ViewOnceState.GONE && viewOnceSupported()) {
viewOnceState = TextSecurePreferences.isViewOnceMessageEnabled(application) ? ViewOnceState.ENABLED : ViewOnceState.DISABLED;
viewOnceState = ViewOnceState.DISABLED;
showViewOnceTooltipIfNecessary(viewOnceState);
} else if (!viewOnceSupported()) {
viewOnceState = ViewOnceState.GONE;
Expand Down Expand Up @@ -272,9 +272,6 @@ void onRevealButtonToggled() {
.toList();

selectedMedia.setValue(uncaptioned);

TextSecurePreferences.setIsViewOnceMessageEnabled(application, viewOnceState == ViewOnceState.ENABLED);

hudState.setValue(buildHudState());
}

Expand Down
Expand Up @@ -200,7 +200,6 @@ public class TextSecurePreferences {

private static final String MEDIA_KEYBOARD_MODE = "pref_media_keyboard_mode";

private static final String VIEW_ONCE_DEFAULT = "pref_revealable_message_default";
private static final String VIEW_ONCE_TOOLTIP_SEEN = "pref_revealable_message_tooltip_seen";

private static final String SEEN_CAMERA_FIRST_TOOLTIP = "pref_seen_camera_first_tooltip";
Expand Down Expand Up @@ -1276,14 +1275,6 @@ public static MediaKeyboardMode getMediaKeyboardMode(Context context) {
return MediaKeyboardMode.valueOf(name);
}

public static void setIsViewOnceMessageEnabled(Context context, boolean value) {
setBooleanPreference(context, VIEW_ONCE_DEFAULT, value);
}

public static boolean isViewOnceMessageEnabled(Context context) {
return getBooleanPreference(context, VIEW_ONCE_DEFAULT, false);
}

public static void setHasSeenViewOnceTooltip(Context context, boolean value) {
setBooleanPreference(context, VIEW_ONCE_TOOLTIP_SEEN, value);
}
Expand Down

0 comments on commit c346f32

Please sign in to comment.