Remove a remote config flag
This commit is contained in:
parent
8c555a9b28
commit
5d3de4ed5d
5 changed files with 3 additions and 20 deletions
|
@ -25,7 +25,6 @@ export type ConfigKeyType =
|
||||||
| 'desktop.internalUser'
|
| 'desktop.internalUser'
|
||||||
| 'desktop.mediaQuality.levels'
|
| 'desktop.mediaQuality.levels'
|
||||||
| 'desktop.messageCleanup'
|
| 'desktop.messageCleanup'
|
||||||
| 'desktop.nicknames'
|
|
||||||
| 'desktop.retryRespondMaxAge'
|
| 'desktop.retryRespondMaxAge'
|
||||||
| 'desktop.senderKey.retry'
|
| 'desktop.senderKey.retry'
|
||||||
| 'desktop.senderKeyMaxAge'
|
| 'desktop.senderKeyMaxAge'
|
||||||
|
|
|
@ -12,10 +12,7 @@ import { UserText } from '../UserText';
|
||||||
import { SharedGroupNames } from '../SharedGroupNames';
|
import { SharedGroupNames } from '../SharedGroupNames';
|
||||||
import { About } from './About';
|
import { About } from './About';
|
||||||
import { I18n } from '../I18n';
|
import { I18n } from '../I18n';
|
||||||
import {
|
import { canHaveNicknameAndNote } from '../../util/nicknames';
|
||||||
areNicknamesEnabled,
|
|
||||||
canHaveNicknameAndNote,
|
|
||||||
} from '../../util/nicknames';
|
|
||||||
import { Tooltip, TooltipPlacement } from '../Tooltip';
|
import { Tooltip, TooltipPlacement } from '../Tooltip';
|
||||||
|
|
||||||
function muted(parts: Array<string | JSX.Element>) {
|
function muted(parts: Array<string | JSX.Element>) {
|
||||||
|
@ -255,7 +252,7 @@ export function AboutContactModal({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{areNicknamesEnabled() && conversation.note && (
|
{conversation.note && (
|
||||||
<div className="AboutContactModal__row">
|
<div className="AboutContactModal__row">
|
||||||
<i className="AboutContactModal__row__icon AboutContactModal__row__icon--note" />
|
<i className="AboutContactModal__row__icon AboutContactModal__row__icon--note" />
|
||||||
<button
|
<button
|
||||||
|
|
|
@ -10,7 +10,6 @@ import { Emojify } from './Emojify';
|
||||||
import type { ProfileNameChangeType } from '../../util/getStringForProfileChange';
|
import type { ProfileNameChangeType } from '../../util/getStringForProfileChange';
|
||||||
import { getStringForProfileChange } from '../../util/getStringForProfileChange';
|
import { getStringForProfileChange } from '../../util/getStringForProfileChange';
|
||||||
import { Button, ButtonSize, ButtonVariant } from '../Button';
|
import { Button, ButtonSize, ButtonVariant } from '../Button';
|
||||||
import { areNicknamesEnabled } from '../../util/nicknames';
|
|
||||||
|
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
change: ProfileNameChangeType;
|
change: ProfileNameChangeType;
|
||||||
|
@ -37,7 +36,6 @@ export function ProfileChangeNotification({
|
||||||
icon="profile"
|
icon="profile"
|
||||||
contents={<Emojify text={message} />}
|
contents={<Emojify text={message} />}
|
||||||
button={
|
button={
|
||||||
areNicknamesEnabled() &&
|
|
||||||
(changedContact.nicknameGivenName != null ||
|
(changedContact.nicknameGivenName != null ||
|
||||||
changedContact.nicknameFamilyName != null) && (
|
changedContact.nicknameFamilyName != null) && (
|
||||||
<Button
|
<Button
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { combineNames } from './combineNames';
|
||||||
import { getRegionCodeForNumber } from './libphonenumberUtil';
|
import { getRegionCodeForNumber } from './libphonenumberUtil';
|
||||||
import { isDirectConversation } from './whatTypeOfConversation';
|
import { isDirectConversation } from './whatTypeOfConversation';
|
||||||
import { getE164 } from './getE164';
|
import { getE164 } from './getE164';
|
||||||
import { areNicknamesEnabled } from './nicknames';
|
|
||||||
|
|
||||||
type TitleOptions = {
|
type TitleOptions = {
|
||||||
isShort?: boolean;
|
isShort?: boolean;
|
||||||
|
@ -42,7 +41,7 @@ export function getTitleNoDefault(
|
||||||
const { username } = attributes;
|
const { username } = attributes;
|
||||||
|
|
||||||
let nicknameValue: string | undefined;
|
let nicknameValue: string | undefined;
|
||||||
if (areNicknamesEnabled() && !ignoreNickname) {
|
if (!ignoreNickname) {
|
||||||
nicknameValue =
|
nicknameValue =
|
||||||
(isShort ? attributes.nicknameGivenName : undefined) ||
|
(isShort ? attributes.nicknameGivenName : undefined) ||
|
||||||
getNicknameName(attributes);
|
getNicknameName(attributes);
|
||||||
|
@ -114,10 +113,6 @@ export function getNicknameName(
|
||||||
'nicknameGivenName' | 'nicknameFamilyName' | 'type'
|
'nicknameGivenName' | 'nicknameFamilyName' | 'type'
|
||||||
>
|
>
|
||||||
): string | undefined {
|
): string | undefined {
|
||||||
if (!areNicknamesEnabled()) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isDirectConversation(attributes)) {
|
if (isDirectConversation(attributes)) {
|
||||||
return combineNames(
|
return combineNames(
|
||||||
attributes.nicknameGivenName ?? undefined,
|
attributes.nicknameGivenName ?? undefined,
|
||||||
|
|
|
@ -1,19 +1,13 @@
|
||||||
// Copyright 2024 Signal Messenger, LLC
|
// Copyright 2024 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import * as RemoteConfig from '../RemoteConfig';
|
|
||||||
import type { ConversationType } from '../state/ducks/conversations';
|
import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import { isSignalConversation } from './isSignalConversation';
|
import { isSignalConversation } from './isSignalConversation';
|
||||||
|
|
||||||
export function areNicknamesEnabled(): boolean {
|
|
||||||
return RemoteConfig.getValue('desktop.nicknames') === 'TRUE';
|
|
||||||
}
|
|
||||||
|
|
||||||
export function canHaveNicknameAndNote(
|
export function canHaveNicknameAndNote(
|
||||||
conversation: ConversationType
|
conversation: ConversationType
|
||||||
): boolean {
|
): boolean {
|
||||||
return (
|
return (
|
||||||
areNicknamesEnabled() &&
|
|
||||||
conversation.type !== 'group' &&
|
conversation.type !== 'group' &&
|
||||||
!isSignalConversation(conversation) &&
|
!isSignalConversation(conversation) &&
|
||||||
!conversation.isMe
|
!conversation.isMe
|
||||||
|
|
Loading…
Reference in a new issue