You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/ts/session/constants.ts

99 lines
2.6 KiB
TypeScript

const seconds = 1000;
const minutes = seconds * 60;
const hours = minutes * 60;
const days = hours * 24;
/** in milliseconds */
export const DURATION = {
/** 1000ms */
SECONDS: seconds,
/** 60 * 1000 = 60,000 ms */
MINUTES: minutes,
/** 60 * 60 * 1000 = 3,600,000 ms */
HOURS: hours,
/** 24 * 60 * 60 * 1000 = 86,400,000 ms */
DAYS: days,
/** 7 * 24 * 60 * 60 * 1000 = 604,800,000 ms */
WEEKS: days * 7,
};
export const FILESIZE = {
/** 1KB */
KB: 1024,
/** 1MB */
MB: 1024 * 1024,
/** 1GB */
GB: 1024 * 1024 * 1024,
};
5 years ago
export const TTL_DEFAULT = {
/** 20 seconds */
TYPING_MESSAGE: 20 * DURATION.SECONDS,
/** 5 minutes */
CALL_MESSAGE: 5 * 60 * DURATION.SECONDS,
/** 14 days */
CONTENT_MESSAGE: 14 * DURATION.DAYS,
/** 30 days */
CONFIG_MESSAGE: 30 * DURATION.DAYS,
5 years ago
};
5 years ago
export const SWARM_POLLING_TIMEOUT = {
/** 5 seconds */
ACTIVE: DURATION.SECONDS * 5,
/** 1 minute */
MEDIUM_ACTIVE: DURATION.SECONDS * 60,
/** 2 minutes */
INACTIVE: DURATION.SECONDS * 120,
};
export const PROTOCOLS = {
HTTP: 'http:',
HTTPS: 'https:',
};
5 years ago
// User Interface
export const CONVERSATION = {
DEFAULT_MEDIA_FETCH_COUNT: 50,
DEFAULT_DOCUMENTS_FETCH_COUNT: 100,
5 years ago
DEFAULT_MESSAGE_FETCH_COUNT: 30,
MAX_MESSAGE_FETCH_COUNT: 1000,
// Maximum voice message duraton of 5 minutes
5 years ago
// which equates to 1.97 MB
MAX_VOICE_MESSAGE_DURATION: 300,
MAX_CONVO_UNREAD_COUNT: 999,
MAX_GLOBAL_UNREAD_COUNT: 99, // the global one does not look good with 4 digits (999+) so we have a smaller one for it
/** NOTE some existing groups might not have joinedAtSeconds and we need a fallback value that is not falsy in order to poll and show up in the conversations list */
LAST_JOINED_FALLBACK_TIMESTAMP: 1,
} as const;
/**
* The file server and onion request max upload size is 10MB precisely.
* 10MB is still ok, but one byte more is not.
*/
export const MAX_ATTACHMENT_FILESIZE_BYTES = 10 * 1000 * 1000;
5 years ago
export const VALIDATION = {
CLOSED_GROUP_SIZE_LIMIT: 100,
};
export const DEFAULT_RECENT_REACTS = ['😂', '🥰', '😢', '😡', '😮', '😈'];
export const REACT_LIMIT = 6;
export const FEATURE_RELEASE_TIMESTAMPS = {
DISAPPEARING_MESSAGES_V2: 1710284400000, // 13/03/2024 10:00 Melbourne time
USER_CONFIG: 1690761600000, // Monday July 31st at 10am Melbourne time
};
export const LOCALE_DEFAULTS = {
app_name: 'Session',
} as const
Merge branch 'unstable' into standardised_strings_merge # Conflicts: # .gitignore # _locales/en/messages.json # ts/components/DebugLogView.tsx # ts/components/SessionWrapperModal.tsx # ts/components/basic/SessionHTMLRenderer.tsx # ts/components/basic/SessionRadio.tsx # ts/components/buttons/MenuButton.tsx # ts/components/conversation/SessionConversation.tsx # ts/components/conversation/SubtleNotification.tsx # ts/components/conversation/TimerNotification.tsx # ts/components/conversation/composition/CompositionBox.tsx # ts/components/conversation/message/message-content/MessageText.tsx # ts/components/conversation/message/message-item/InteractionNotification.tsx # ts/components/conversation/message/reactions/ReactionPopup.tsx # ts/components/conversation/right-panel/overlay/OverlayRightPanelSettings.tsx # ts/components/conversation/right-panel/overlay/disappearing-messages/DisappearingModes.tsx # ts/components/conversation/right-panel/overlay/disappearing-messages/OverlayDisappearingMessages.tsx # ts/components/dialog/BanOrUnbanUserDialog.tsx # ts/components/dialog/DeleteAccountModal.tsx # ts/components/dialog/EditProfileDialog.tsx # ts/components/dialog/ModeratorsAddDialog.tsx # ts/components/dialog/OnionStatusPathDialog.tsx # ts/components/dialog/ReactListModal.tsx # ts/components/dialog/SessionSeedModal.tsx # ts/components/dialog/SessionSetPasswordDialog.tsx # ts/components/dialog/UserDetailsDialog.tsx # ts/components/leftpane/LeftPaneSectionHeader.tsx # ts/components/leftpane/LeftPaneSettingSection.tsx # ts/components/leftpane/conversation-list-item/InteractionItem.tsx # ts/components/leftpane/overlay/OverlayClosedGroup.tsx # ts/components/leftpane/overlay/OverlayCommunity.tsx # ts/components/leftpane/overlay/OverlayMessage.tsx # ts/components/leftpane/overlay/SessionJoinableDefaultRooms.tsx # ts/components/leftpane/overlay/choose-action/ContactsListWithBreaks.tsx # ts/components/leftpane/overlay/choose-action/OverlayChooseAction.tsx # ts/components/menu/Menu.tsx # ts/components/registration/RegistrationStages.tsx # ts/components/registration/RegistrationUserDetails.tsx # ts/components/registration/SignInTab.tsx # ts/components/registration/SignUpTab.tsx # ts/components/settings/SessionSettings.tsx # ts/components/settings/SessionSettingsHeader.tsx # ts/components/settings/ZoomingSessionSlider.tsx # ts/components/settings/section/CategoryAppearance.tsx # ts/components/settings/section/CategoryHelp.tsx # ts/components/settings/section/CategoryPermissions.tsx # ts/components/settings/section/CategoryPrivacy.tsx # ts/hooks/useParamSelector.ts # ts/mains/main_renderer.tsx # ts/models/message.ts # ts/node/menu.ts # ts/node/tray_icon.ts # ts/session/constants.ts # ts/session/disappearing_messages/timerOptions.ts # ts/session/utils/Toast.tsx # ts/state/selectors/search.ts # ts/test/session/unit/selectors/conversations_test.ts # ts/types/LocalizerKeys.ts # ts/types/Util.ts # ts/window.d.ts # yarn.lock
9 months ago
export const ONBOARDING_TIMES = {
/** 15 seconds */
RECOVERY_TIMEOUT: 15 * DURATION.SECONDS,
/** 0.3 seconds */
RECOVERY_FINISHING: 0.3 * DURATION.SECONDS,
/** 0.2 seconds */
RECOVERY_FINISHED: 0.2 * DURATION.SECONDS,
};