keep read-receipts disabled by default (#2071)
This commit is contained in:
parent
48e7a0e25f
commit
95e40c9509
|
@ -156,7 +156,6 @@
|
||||||
"spellCheckDirty": "You must restart Session to apply your new settings",
|
"spellCheckDirty": "You must restart Session to apply your new settings",
|
||||||
"notifications": "Notifications",
|
"notifications": "Notifications",
|
||||||
"readReceiptSettingDescription": "See and share when messages have been read (enables read receipts in all sessions).",
|
"readReceiptSettingDescription": "See and share when messages have been read (enables read receipts in all sessions).",
|
||||||
"readReceiptDialogDescription": "Read Receipts are now turned ON by default. Click \"Cancel\" to turn them down.",
|
|
||||||
"readReceiptSettingTitle": "Read Receipts",
|
"readReceiptSettingTitle": "Read Receipts",
|
||||||
"typingIndicatorsSettingDescription": "See and share when messages are being typed (applies to all sessions).",
|
"typingIndicatorsSettingDescription": "See and share when messages are being typed (applies to all sessions).",
|
||||||
"typingIndicatorsSettingTitle": "Typing Indicators",
|
"typingIndicatorsSettingTitle": "Typing Indicators",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { Dispatch, useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { SessionIconButton } from './icon';
|
import { SessionIconButton } from './icon';
|
||||||
import { Avatar, AvatarSize } from '../Avatar';
|
import { Avatar, AvatarSize } from '../Avatar';
|
||||||
import { SessionToastContainer } from './SessionToastContainer';
|
import { SessionToastContainer } from './SessionToastContainer';
|
||||||
|
@ -6,7 +6,6 @@ import { getConversationController } from '../../session/conversations';
|
||||||
import { syncConfigurationIfNeeded } from '../../session/utils/syncUtils';
|
import { syncConfigurationIfNeeded } from '../../session/utils/syncUtils';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createOrUpdateItem,
|
|
||||||
generateAttachmentKeyIfEmpty,
|
generateAttachmentKeyIfEmpty,
|
||||||
getAllOpenGroupV1Conversations,
|
getAllOpenGroupV1Conversations,
|
||||||
getItemById,
|
getItemById,
|
||||||
|
@ -37,11 +36,7 @@ import { forceRefreshRandomSnodePool } from '../../session/snode_api/snodePool';
|
||||||
import { getSwarmPollingInstance } from '../../session/snode_api';
|
import { getSwarmPollingInstance } from '../../session/snode_api';
|
||||||
import { DURATION } from '../../session/constants';
|
import { DURATION } from '../../session/constants';
|
||||||
import { conversationChanged, conversationRemoved } from '../../state/ducks/conversations';
|
import { conversationChanged, conversationRemoved } from '../../state/ducks/conversations';
|
||||||
import {
|
import { editProfileModal, onionPathModal } from '../../state/ducks/modalDialog';
|
||||||
editProfileModal,
|
|
||||||
onionPathModal,
|
|
||||||
updateConfirmModal,
|
|
||||||
} from '../../state/ducks/modalDialog';
|
|
||||||
import { uploadOurAvatar } from '../../interactions/conversationInteractions';
|
import { uploadOurAvatar } from '../../interactions/conversationInteractions';
|
||||||
import { ModalContainer } from '../dialog/ModalContainer';
|
import { ModalContainer } from '../dialog/ModalContainer';
|
||||||
import { debounce } from 'underscore';
|
import { debounce } from 'underscore';
|
||||||
|
@ -54,29 +49,7 @@ import { switchHtmlToDarkTheme, switchHtmlToLightTheme } from '../../state/ducks
|
||||||
import { DraggableCallContainer } from './calling/DraggableCallContainer';
|
import { DraggableCallContainer } from './calling/DraggableCallContainer';
|
||||||
import { IncomingCallDialog } from './calling/IncomingCallDialog';
|
import { IncomingCallDialog } from './calling/IncomingCallDialog';
|
||||||
import { CallInFullScreenContainer } from './calling/CallInFullScreenContainer';
|
import { CallInFullScreenContainer } from './calling/CallInFullScreenContainer';
|
||||||
import { SessionButtonColor } from './SessionButton';
|
|
||||||
import { settingsReadReceipt } from './settings/section/CategoryPrivacy';
|
|
||||||
|
|
||||||
async function showTurnOnReadAck(dispatch: Dispatch<any>) {
|
|
||||||
const singleShotSettingId = 'read-receipt-turn-on-asked';
|
|
||||||
const item = (await getItemById(singleShotSettingId))?.value || false;
|
|
||||||
|
|
||||||
if (!item) {
|
|
||||||
await createOrUpdateItem({ id: singleShotSettingId, value: true });
|
|
||||||
// set it to true by default, user will be asked to willingfully turn it off
|
|
||||||
window.setSettingValue(settingsReadReceipt, true);
|
|
||||||
dispatch(
|
|
||||||
updateConfirmModal({
|
|
||||||
title: window.i18n('readReceiptSettingTitle'),
|
|
||||||
messageSub: window.i18n('readReceiptDialogDescription'),
|
|
||||||
okTheme: SessionButtonColor.Green,
|
|
||||||
onClickCancel: () => {
|
|
||||||
window.setSettingValue(settingsReadReceipt, false);
|
|
||||||
},
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const Section = (props: { type: SectionType }) => {
|
const Section = (props: { type: SectionType }) => {
|
||||||
const ourNumber = useSelector(getOurNumber);
|
const ourNumber = useSelector(getOurNumber);
|
||||||
const unreadMessageCount = useSelector(getUnreadMessageCount);
|
const unreadMessageCount = useSelector(getUnreadMessageCount);
|
||||||
|
@ -254,7 +227,7 @@ const triggerAvatarReUploadIfNeeded = async () => {
|
||||||
/**
|
/**
|
||||||
* This function is called only once: on app startup with a logged in user
|
* This function is called only once: on app startup with a logged in user
|
||||||
*/
|
*/
|
||||||
const doAppStartUp = (dispatch: Dispatch<any>) => {
|
const doAppStartUp = () => {
|
||||||
// init the messageQueue. In the constructor, we add all not send messages
|
// init the messageQueue. In the constructor, we add all not send messages
|
||||||
// this call does nothing except calling the constructor, which will continue sending message in the pipeline
|
// this call does nothing except calling the constructor, which will continue sending message in the pipeline
|
||||||
void getMessageQueue().processAllPending();
|
void getMessageQueue().processAllPending();
|
||||||
|
@ -273,8 +246,6 @@ const doAppStartUp = (dispatch: Dispatch<any>) => {
|
||||||
|
|
||||||
void loadDefaultRooms();
|
void loadDefaultRooms();
|
||||||
|
|
||||||
void showTurnOnReadAck(dispatch);
|
|
||||||
|
|
||||||
debounce(triggerAvatarReUploadIfNeeded, 200);
|
debounce(triggerAvatarReUploadIfNeeded, 200);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -296,11 +267,10 @@ export const ActionsPanel = () => {
|
||||||
const [startCleanUpMedia, setStartCleanUpMedia] = useState(false);
|
const [startCleanUpMedia, setStartCleanUpMedia] = useState(false);
|
||||||
const ourPrimaryConversation = useSelector(getOurPrimaryConversation);
|
const ourPrimaryConversation = useSelector(getOurPrimaryConversation);
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
// this maxi useEffect is called only once: when the component is mounted.
|
// this maxi useEffect is called only once: when the component is mounted.
|
||||||
// For the action panel, it means this is called only one per app start/with a user loggedin
|
// For the action panel, it means this is called only one per app start/with a user loggedin
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
void doAppStartUp(dispatch);
|
void doAppStartUp();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// wait for cleanUpMediasInterval and then start cleaning up medias
|
// wait for cleanUpMediasInterval and then start cleaning up medias
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { PasswordAction } from '../../../dialog/SessionPasswordDialog';
|
||||||
import { SessionButtonColor } from '../../SessionButton';
|
import { SessionButtonColor } from '../../SessionButton';
|
||||||
import { SessionSettingButtonItem, SessionToggleWithDescription } from '../SessionSettingListItem';
|
import { SessionSettingButtonItem, SessionToggleWithDescription } from '../SessionSettingListItem';
|
||||||
|
|
||||||
export const settingsReadReceipt = 'read-receipt-setting';
|
const settingsReadReceipt = 'read-receipt-setting';
|
||||||
const settingsTypingIndicator = 'typing-indicators-setting';
|
const settingsTypingIndicator = 'typing-indicators-setting';
|
||||||
const settingsAutoUpdate = 'auto-update';
|
const settingsAutoUpdate = 'auto-update';
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,6 @@ export type LocalizerKeys =
|
||||||
| 'timerOption_0_seconds_abbreviated'
|
| 'timerOption_0_seconds_abbreviated'
|
||||||
| 'timerOption_5_minutes_abbreviated'
|
| 'timerOption_5_minutes_abbreviated'
|
||||||
| 'enterOptionalPassword'
|
| 'enterOptionalPassword'
|
||||||
| 'userRemovedFromModerators'
|
|
||||||
| 'goToReleaseNotes'
|
| 'goToReleaseNotes'
|
||||||
| 'unpinConversation'
|
| 'unpinConversation'
|
||||||
| 'viewMenuResetZoom'
|
| 'viewMenuResetZoom'
|
||||||
|
@ -341,7 +340,7 @@ export type LocalizerKeys =
|
||||||
| 'youDisabledDisappearingMessages'
|
| 'youDisabledDisappearingMessages'
|
||||||
| 'updateGroupDialogTitle'
|
| 'updateGroupDialogTitle'
|
||||||
| 'surveyTitle'
|
| 'surveyTitle'
|
||||||
| 'readReceiptDialogDescription'
|
| 'userRemovedFromModerators'
|
||||||
| 'timerOption_5_seconds'
|
| 'timerOption_5_seconds'
|
||||||
| 'failedToRemoveFromModerator'
|
| 'failedToRemoveFromModerator'
|
||||||
| 'conversationsHeader'
|
| 'conversationsHeader'
|
||||||
|
|
|
@ -149,9 +149,8 @@ async function createAccount(identityKeyPair: any) {
|
||||||
await window.textsecure.storage.put('identityKey', identityKeyPair);
|
await window.textsecure.storage.put('identityKey', identityKeyPair);
|
||||||
await window.textsecure.storage.put('password', password);
|
await window.textsecure.storage.put('password', password);
|
||||||
|
|
||||||
// enable read-receipt by default
|
// disable read-receipt by default
|
||||||
await window.textsecure.storage.put('read-receipt-setting', true);
|
await window.textsecure.storage.put('read-receipt-setting', false);
|
||||||
await window.textsecure.storage.put('read-receipt-turn-on-asked', true); // this can be removed once enough people upgraded 8/12/2021
|
|
||||||
|
|
||||||
// Enable typing indicators by default
|
// Enable typing indicators by default
|
||||||
await window.textsecure.storage.put('typing-indicators-setting', true);
|
await window.textsecure.storage.put('typing-indicators-setting', true);
|
||||||
|
|
Loading…
Reference in New Issue