Removing msg req feature flag.

pull/2170/head
warrickct 3 years ago
parent 8a8a5ca82c
commit ac8c4ac2eb

@ -439,7 +439,7 @@
"messageRequests": "Message Requests", "messageRequests": "Message Requests",
"requestsSubtitle": "Pending Requests", "requestsSubtitle": "Pending Requests",
"requestsPlaceholder": "No requests", "requestsPlaceholder": "No requests",
"messageRequestsDescription": "Enable Message Request Inbox", "messageRequestsDescription": "Always show the Message Request inbox",
"incomingCallFrom": "Incoming call from '$name$'", "incomingCallFrom": "Incoming call from '$name$'",
"ringing": "Ringing...", "ringing": "Ringing...",
"establishingConnection": "Establishing connection...", "establishingConnection": "Establishing connection...",
@ -471,5 +471,8 @@
"messageRequestAcceptedOurs": "You have accepted $name$'s message request", "messageRequestAcceptedOurs": "You have accepted $name$'s message request",
"messageRequestAcceptedOursNoName": "You have accepted the message request", "messageRequestAcceptedOursNoName": "You have accepted the message request",
"declineRequestMessage": "Are you sure you want to decline this message request?", "declineRequestMessage": "Are you sure you want to decline this message request?",
"respondingToRequestWarning": "Sending a message to this user will automatically accept their message request and reveal your Session ID." "respondingToRequestWarning": "Sending a message to this user will automatically accept their message request and reveal your Session ID.",
"alwaysShowMessageRequests": "Always show Message Requests",
"openMessageRequestInbox": "View Message Requests",
"openMessageRequestInboxDescription": "View your Message Request inbox"
} }

@ -37,7 +37,6 @@ window.isBehindProxy = () => Boolean(config.proxyUrl);
window.lokiFeatureFlags = { window.lokiFeatureFlags = {
useOnionRequests: true, useOnionRequests: true,
useMessageRequests: true,
useCallMessage: true, useCallMessage: true,
}; };

@ -230,9 +230,7 @@ export class SessionConversation extends React.Component<Props, State> {
const isApproved = selectedConversation.isApproved; const isApproved = selectedConversation.isApproved;
const selectionMode = selectedMessages.length > 0; const selectionMode = selectedMessages.length > 0;
const useMsgRequests = const useMsgRequests = window.inboxStore?.getState().userConfig.messageRequests;
window.lokiFeatureFlags.useMessageRequests &&
window.inboxStore?.getState().userConfig.messageRequests;
const showMsgRequestUI = useMsgRequests && !isApproved && messagesProps.length > 0; const showMsgRequestUI = useMsgRequests && !isApproved && messagesProps.length > 0;
const handleDeclineConversationRequest = async () => { const handleDeclineConversationRequest = async () => {

@ -123,13 +123,11 @@ export class LeftPaneMessageSection extends React.Component<Props> {
onChange={this.updateSearch} onChange={this.updateSearch}
placeholder={window.i18n('searchFor...')} placeholder={window.i18n('searchFor...')}
/> />
{window.lokiFeatureFlags.useMessageRequests ? ( <MessageRequestsBanner
<MessageRequestsBanner handleOnClick={() => {
handleOnClick={() => { window.inboxStore?.dispatch(setOverlayMode('message-requests'));
window.inboxStore?.dispatch(setOverlayMode('message-requests')); }}
}} />
/>
) : null}
{this.renderList()} {this.renderList()}
{this.renderBottomButtons()} {this.renderBottomButtons()}
</div> </div>

@ -18,14 +18,7 @@ import useKey from 'react-use/lib/useKey';
* Blocks all message request conversations and synchronizes across linked devices * Blocks all message request conversations and synchronizes across linked devices
* @returns void * @returns void
*/ */
async function handleBlockAllRequestsClick(messageRequestSetting: boolean) { async function handleBlockAllRequestsClick() {
const messageRequestsEnabled =
messageRequestSetting && window?.lokiFeatureFlags?.useMessageRequests;
if (!messageRequestsEnabled) {
return;
}
// block all convo requests. Force sync if there were changes. // block all convo requests. Force sync if there were changes.
window?.log?.info('Blocking all conversations'); window?.log?.info('Blocking all conversations');
const conversations = getConversationController().getConversations(); const conversations = getConversationController().getConversations();

@ -57,8 +57,6 @@ export const SettingsCategoryPrivacy = (props: {
const forceUpdate = useUpdate(); const forceUpdate = useUpdate();
const dispatch = useDispatch(); const dispatch = useDispatch();
const hasMessageRequestFlag = window.lokiFeatureFlags.useMessageRequests;
if (props.hasPassword !== null) { if (props.hasPassword !== null) {
return ( return (
<> <>
@ -112,16 +110,23 @@ export const SettingsCategoryPrivacy = (props: {
description={window.i18n('autoUpdateSettingDescription')} description={window.i18n('autoUpdateSettingDescription')}
active={Boolean(window.getSettingValue(SettingsKey.settingsAutoUpdate))} active={Boolean(window.getSettingValue(SettingsKey.settingsAutoUpdate))}
/> />
{hasMessageRequestFlag && ( <SessionToggleWithDescription
<SessionToggleWithDescription onClickToggle={() => {
onClickToggle={() => { dispatch(toggleMessageRequests());
dispatch(toggleMessageRequests()); }}
}} title={window.i18n('alwaysShowMessageRequests')}
title={window.i18n('messageRequests')} description={window.i18n('messageRequestsDescription')}
description={window.i18n('messageRequestsDescription')} active={useSelector(getIsMessageRequestsEnabled)}
active={useSelector(getIsMessageRequestsEnabled)} />
/> <SessionSettingButtonItem
)} title={window.i18n('openMessageRequestInbox')}
description={window.i18n('openMessageRequestInboxDescription')}
onClick={() => {
// TODO: open msg request inbox
}}
buttonColor={SessionButtonColor.Primary}
buttonText={window.i18n('openMessageRequestInbox')}
/>
{!props.hasPassword && ( {!props.hasPassword && (
<SessionSettingButtonItem <SessionSettingButtonItem
title={window.i18n('setAccountPasswordTitle')} title={window.i18n('setAccountPasswordTitle')}

@ -1595,9 +1595,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
) { ) {
return false; return false;
} }
const msgRequestsEnabled = const msgRequestsEnabled = window.inboxStore?.getState().userConfig.messageRequests;
window.lokiFeatureFlags.useMessageRequests &&
window.inboxStore?.getState().userConfig.messageRequests;
// if msg requests are unused, we have to send typing (this is already a private active unblocked convo) // if msg requests are unused, we have to send typing (this is already a private active unblocked convo)
if (!msgRequestsEnabled) { if (!msgRequestsEnabled) {

@ -140,10 +140,7 @@ const handleContactReceived = async (
contactConvo.set('active_at', _.toNumber(envelope.timestamp)); contactConvo.set('active_at', _.toNumber(envelope.timestamp));
} }
if ( if (window.inboxStore?.getState().userConfig.messageRequests) {
window.lokiFeatureFlags.useMessageRequests &&
window.inboxStore?.getState().userConfig.messageRequests
) {
if (contactReceived.isApproved) { if (contactReceived.isApproved) {
await contactConvo.setIsApproved(Boolean(contactReceived.isApproved)); await contactConvo.setIsApproved(Boolean(contactReceived.isApproved));

@ -340,14 +340,11 @@ export const _getLeftPaneLists = (
let unreadCount = 0; let unreadCount = 0;
for (const conversation of sortedConversations) { for (const conversation of sortedConversations) {
const excludeUnapproved =
isMessageRequestEnabled && window.lokiFeatureFlags?.useMessageRequests;
if (conversation.activeAt !== undefined && conversation.type === ConversationTypeEnum.PRIVATE) { if (conversation.activeAt !== undefined && conversation.type === ConversationTypeEnum.PRIVATE) {
directConversations.push(conversation); directConversations.push(conversation);
} }
if (excludeUnapproved && !conversation.isApproved && !conversation.isBlocked) { if (isMessageRequestEnabled && !conversation.isApproved && !conversation.isBlocked) {
// dont increase unread counter, don't push to convo list. // dont increase unread counter, don't push to convo list.
continue; continue;
} }
@ -434,11 +431,9 @@ const _getConversationRequests = (
sortedConversations: Array<ReduxConversationType>, sortedConversations: Array<ReduxConversationType>,
isMessageRequestEnabled?: boolean isMessageRequestEnabled?: boolean
): Array<ReduxConversationType> => { ): Array<ReduxConversationType> => {
const pushToMessageRequests =
isMessageRequestEnabled && window?.lokiFeatureFlags?.useMessageRequests;
return _.filter(sortedConversations, conversation => { return _.filter(sortedConversations, conversation => {
return ( return (
pushToMessageRequests && isMessageRequestEnabled &&
!conversation.isApproved && !conversation.isApproved &&
!conversation.isBlocked && !conversation.isBlocked &&
conversation.isPrivate && conversation.isPrivate &&
@ -457,17 +452,13 @@ const _getPrivateContactsPubkeys = (
sortedConversations: Array<ReduxConversationType>, sortedConversations: Array<ReduxConversationType>,
isMessageRequestEnabled?: boolean isMessageRequestEnabled?: boolean
): Array<string> => { ): Array<string> => {
const pushToMessageRequests =
(isMessageRequestEnabled && window?.lokiFeatureFlags?.useMessageRequests) ||
!isMessageRequestEnabled;
return _.filter(sortedConversations, conversation => { return _.filter(sortedConversations, conversation => {
return ( return (
conversation.isPrivate && conversation.isPrivate &&
!conversation.isBlocked && !conversation.isBlocked &&
!conversation.isMe && !conversation.isMe &&
(conversation.didApproveMe || !pushToMessageRequests) && (conversation.didApproveMe || !isMessageRequestEnabled) &&
(conversation.isApproved || !pushToMessageRequests) && (conversation.isApproved || !isMessageRequestEnabled) &&
Boolean(conversation.activeAt) Boolean(conversation.activeAt)
); );
}).map(convo => convo.id); }).map(convo => convo.id);

@ -471,4 +471,7 @@ export type LocalizerKeys =
| 'messageRequestAcceptedOurs' | 'messageRequestAcceptedOurs'
| 'messageRequestAcceptedOursNoName' | 'messageRequestAcceptedOursNoName'
| 'declineRequestMessage' | 'declineRequestMessage'
| 'openMessageRequestInbox'
| 'openMessageRequestInboxDescription'
| 'alwaysShowMessageRequests'
| 'reportIssue'; | 'reportIssue';

Loading…
Cancel
Save