Implement video length enforcement for Stories.

This commit is contained in:
Alex Hart
2022-06-21 16:05:52 -03:00
committed by Cody Henthorne
parent 2c3d8337c3
commit 6a385c7a22
26 changed files with 597 additions and 108 deletions

View File

@@ -23,11 +23,21 @@ internal class StoryValues(store: KeyValueStore) : SignalStoreValues(store) {
* Rolling window of latest two private or group stories a user has sent to.
*/
private const val LATEST_STORY_SENDS = "latest.story.sends"
/**
* Video Trim tooltip marker
*/
private const val VIDEO_TOOLTIP_SEEN_MARKER = "stories.video.will.be.trimmed.tooltip.seen"
/**
* Cannot send to story tooltip marker
*/
private const val CANNOT_SEND_SEEN_MARKER = "stories.cannot.send.video.tooltip.seen"
}
override fun onFirstEverAppLaunch() = Unit
override fun getKeysToIncludeInBackup(): MutableList<String> = mutableListOf(MANUAL_FEATURE_DISABLE, USER_HAS_ADDED_TO_A_STORY)
override fun getKeysToIncludeInBackup(): MutableList<String> = mutableListOf(MANUAL_FEATURE_DISABLE, USER_HAS_ADDED_TO_A_STORY, VIDEO_TOOLTIP_SEEN_MARKER, CANNOT_SEND_SEEN_MARKER)
var isFeatureDisabled: Boolean by booleanValue(MANUAL_FEATURE_DISABLE, false)
@@ -35,6 +45,10 @@ internal class StoryValues(store: KeyValueStore) : SignalStoreValues(store) {
var userHasBeenNotifiedAboutStories: Boolean by booleanValue(USER_HAS_ADDED_TO_A_STORY, false)
var videoTooltipSeen by booleanValue(VIDEO_TOOLTIP_SEEN_MARKER, false)
var cannotSendTooltipSeen by booleanValue(CANNOT_SEND_SEEN_MARKER, false)
fun setLatestStorySend(storySend: StorySend) {
synchronized(this) {
val storySends: List<StorySend> = getList(LATEST_STORY_SENDS, StorySendSerializer)