diff --git a/src/api/gramjs/apiBuilders/common.ts b/src/api/gramjs/apiBuilders/common.ts index 69c1aafd6..515489124 100644 --- a/src/api/gramjs/apiBuilders/common.ts +++ b/src/api/gramjs/apiBuilders/common.ts @@ -148,6 +148,7 @@ export function buildApiUsernames(mtpPeer: GramJs.User | GramJs.Channel | GramJs export function buildPrivacyRules(rules: GramJs.TypePrivacyRule[]): ApiPrivacySettings { let visibility: PrivacyVisibility | undefined; + let isUnspecified: boolean | undefined; let allowUserIds: string[] | undefined; let allowChatIds: string[] | undefined; let blockUserIds: string[] | undefined; @@ -165,7 +166,6 @@ export function buildPrivacyRules(rules: GramJs.TypePrivacyRule[]): ApiPrivacySe } else if (rule instanceof GramJs.PrivacyValueDisallowAll) { visibility ||= 'nobody'; } else if (rule instanceof GramJs.PrivacyValueAllowUsers) { - visibility ||= 'selectedContacts'; allowUserIds = rule.users.map((chatId) => buildApiPeerId(chatId, 'user')); } else if (rule instanceof GramJs.PrivacyValueDisallowUsers) { blockUserIds = rule.users.map((chatId) => buildApiPeerId(chatId, 'user')); @@ -179,10 +179,12 @@ export function buildPrivacyRules(rules: GramJs.TypePrivacyRule[]): ApiPrivacySe if (!visibility) { // Disallow by default visibility = 'nobody'; + isUnspecified = true; } return { visibility, + isUnspecified, allowUserIds: allowUserIds || [], allowChatIds: allowChatIds || [], blockUserIds: blockUserIds || [], diff --git a/src/api/gramjs/apiBuilders/misc.ts b/src/api/gramjs/apiBuilders/misc.ts index 495ae4eff..6335a4815 100644 --- a/src/api/gramjs/apiBuilders/misc.ts +++ b/src/api/gramjs/apiBuilders/misc.ts @@ -64,6 +64,8 @@ export function buildPrivacyKey(key: GramJs.TypePrivacyKey): ApiPrivacyKey | und switch (key.className) { case 'PrivacyKeyPhoneNumber': return 'phoneNumber'; + case 'PrivacyKeyAddedByPhone': + return 'addByPhone'; case 'PrivacyKeyStatusTimestamp': return 'lastSeen'; case 'PrivacyKeyProfilePhoto': diff --git a/src/api/gramjs/gramjsBuilders/index.ts b/src/api/gramjs/gramjsBuilders/index.ts index 844433abe..61260ac37 100644 --- a/src/api/gramjs/gramjsBuilders/index.ts +++ b/src/api/gramjs/gramjsBuilders/index.ts @@ -2,7 +2,7 @@ import BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; import { generateRandomBytes, readBigIntFromBuffer } from '../../../lib/gramjs/Helpers'; -import type { ApiPrivacyKey, PrivacyVisibility } from '../../../types'; +import type { ApiInputPrivacyRules, ApiPrivacyKey } from '../../../types'; import type { ApiBotApp, ApiChatAdminRights, @@ -25,7 +25,6 @@ import type { ApiStorySkipped, ApiThemeParameters, ApiTypeReplyTo, - ApiUser, ApiVideo, } from '../../types'; import { @@ -458,6 +457,9 @@ export function buildInputPrivacyKey(privacyKey: ApiPrivacyKey) { case 'phoneNumber': return new GramJs.InputPrivacyKeyPhoneNumber(); + case 'addByPhone': + return new GramJs.InputPrivacyKeyAddedByPhone(); + case 'lastSeen': return new GramJs.InputPrivacyKeyStatusTimestamp(); @@ -478,6 +480,9 @@ export function buildInputPrivacyKey(privacyKey: ApiPrivacyKey) { case 'voiceMessages': return new GramJs.InputPrivacyKeyVoiceMessages(); + + case 'bio': + return new GramJs.InputPrivacyKeyAbout(); } return undefined; @@ -660,63 +665,54 @@ export function buildInputReplyTo(replyingTo: ApiTypeReplyTo) { } export function buildInputPrivacyRules( - visibility: PrivacyVisibility, - allowedUserList?: ApiUser[], - deniedUserList?: ApiUser[], + rules: ApiInputPrivacyRules, ) { - const rules: GramJs.TypeInputPrivacyRule[] = []; + const privacyRules: GramJs.TypeInputPrivacyRule[] = []; - switch (visibility) { - case 'everybody': - case 'contacts': { - if (visibility === 'contacts') { - rules.push(new GramJs.InputPrivacyValueAllowContacts()); - } - - if (visibility === 'everybody') { - rules.push(new GramJs.InputPrivacyValueAllowAll()); - } - - const users = deniedUserList?.reduce((acc, { id, accessHash }) => { - acc.push(new GramJs.InputPeerUser({ - userId: buildMtpPeerId(id, 'user'), - accessHash: BigInt(accessHash!), - })); - return acc; - }, []); - - if (users?.length) { - rules.push(new GramJs.InputPrivacyValueDisallowUsers({ users })); - } - break; - } - - case 'closeFriends': - rules.push(new GramJs.InputPrivacyValueAllowCloseFriends()); - break; - - case 'nonContacts': - rules.push(new GramJs.InputPrivacyValueDisallowContacts()); - break; - - case 'selectedContacts': { - const users = (allowedUserList || []).reduce((acc, { id, accessHash }) => { - acc.push(new GramJs.InputPeerUser({ - userId: buildMtpPeerId(id, 'user'), - accessHash: BigInt(accessHash!), - })); - - return acc; - }, []); - - rules.push(new GramJs.InputPrivacyValueAllowUsers({ users })); - break; - } - - case 'nobody': - rules.push(new GramJs.InputPrivacyValueDisallowAll()); - break; + if (rules.allowedUsers?.length) { + privacyRules.push(new GramJs.InputPrivacyValueAllowUsers({ + users: rules.allowedUsers.map(({ id, accessHash }) => buildInputEntity(id, accessHash) as GramJs.InputUser), + })); + } + if (rules.allowedChats?.length) { + privacyRules.push(new GramJs.InputPrivacyValueAllowChatParticipants({ + chats: rules.allowedChats.map(({ id, type }) => ( + buildMtpPeerId(id, type === 'chatTypeBasicGroup' ? 'chat' : 'channel') + )), + })); + } + if (rules.blockedUsers?.length) { + privacyRules.push(new GramJs.InputPrivacyValueDisallowUsers({ + users: rules.blockedUsers.map(({ id, accessHash }) => buildInputEntity(id, accessHash) as GramJs.InputUser), + })); + } + if (rules.blockedChats?.length) { + privacyRules.push(new GramJs.InputPrivacyValueDisallowChatParticipants({ + chats: rules.blockedChats.map(({ id, type }) => ( + buildMtpPeerId(id, type === 'chatTypeBasicGroup' ? 'chat' : 'channel') + )), + })); } - return rules; + if (!rules.isUnspecified) { + switch (rules.visibility) { + case 'everybody': + privacyRules.push(new GramJs.InputPrivacyValueAllowAll()); + break; + + case 'contacts': + privacyRules.push(new GramJs.InputPrivacyValueAllowContacts()); + break; + + case 'nonContacts': + privacyRules.push(new GramJs.InputPrivacyValueDisallowContacts()); + break; + + case 'nobody': + privacyRules.push(new GramJs.InputPrivacyValueDisallowAll()); + break; + } + } + + return privacyRules; } diff --git a/src/api/gramjs/methods/settings.ts b/src/api/gramjs/methods/settings.ts index 3405ea981..96d6acab3 100644 --- a/src/api/gramjs/methods/settings.ts +++ b/src/api/gramjs/methods/settings.ts @@ -2,7 +2,7 @@ import BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; import type { LANG_PACKS } from '../../../config'; -import type { ApiPrivacyKey, InputPrivacyRules, LangCode } from '../../../types'; +import type { ApiInputPrivacyRules, ApiPrivacyKey, LangCode } from '../../../types'; import type { ApiAppConfig, ApiConfig, @@ -33,6 +33,7 @@ import { buildApiUser } from '../apiBuilders/users'; import { buildInputEntity, buildInputPeer, buildInputPhoto, buildInputPrivacyKey, + buildInputPrivacyRules, } from '../gramjsBuilders'; import { addEntitiesToLocalDb, addPhotoToLocalDb } from '../helpers'; import localDb from '../localDb'; @@ -506,48 +507,10 @@ export function unregisterDevice(token: string) { } export async function setPrivacySettings( - privacyKey: ApiPrivacyKey, rules: InputPrivacyRules, + privacyKey: ApiPrivacyKey, rules: ApiInputPrivacyRules, ) { const key = buildInputPrivacyKey(privacyKey); - const privacyRules: GramJs.TypeInputPrivacyRule[] = []; - - if (rules.allowedUsers) { - privacyRules.push(new GramJs.InputPrivacyValueAllowUsers({ - users: rules.allowedUsers.map(({ id, accessHash }) => buildInputEntity(id, accessHash) as GramJs.InputUser), - })); - } - if (rules.allowedChats) { - privacyRules.push(new GramJs.InputPrivacyValueAllowChatParticipants({ - chats: rules.allowedChats.map(({ id }) => buildInputEntity(id) as BigInt.BigInteger), - })); - } - if (rules.blockedUsers) { - privacyRules.push(new GramJs.InputPrivacyValueDisallowUsers({ - users: rules.blockedUsers.map(({ id, accessHash }) => buildInputEntity(id, accessHash) as GramJs.InputUser), - })); - } - if (rules.blockedChats) { - privacyRules.push(new GramJs.InputPrivacyValueDisallowChatParticipants({ - chats: rules.blockedChats.map(({ id }) => buildInputEntity(id) as BigInt.BigInteger), - })); - } - switch (rules.visibility) { - case 'everybody': - privacyRules.push(new GramJs.InputPrivacyValueAllowAll()); - break; - - case 'contacts': - privacyRules.push(new GramJs.InputPrivacyValueAllowContacts()); - break; - - case 'nonContacts': - privacyRules.push(new GramJs.InputPrivacyValueDisallowContacts()); - break; - - case 'nobody': - privacyRules.push(new GramJs.InputPrivacyValueDisallowAll()); - break; - } + const privacyRules = buildInputPrivacyRules(rules); const result = await invokeRequest(new GramJs.account.SetPrivacy({ key, rules: privacyRules })); diff --git a/src/api/gramjs/methods/stories.ts b/src/api/gramjs/methods/stories.ts index 3a27fc810..9a3dab5e5 100644 --- a/src/api/gramjs/methods/stories.ts +++ b/src/api/gramjs/methods/stories.ts @@ -1,6 +1,6 @@ import { Api as GramJs } from '../../../lib/gramjs'; -import type { PrivacyVisibility } from '../../../types'; +import type { ApiInputPrivacyRules } from '../../../types'; import type { ApiReaction, ApiReportReason, ApiStealthMode, ApiTypeStory, ApiUser, ApiUserStories, @@ -306,16 +306,15 @@ export function reportStory({ } export function editStoryPrivacy({ - id, visibility, allowedUserList, deniedUserList, + id, + privacy, }: { id: number; - visibility: PrivacyVisibility; - allowedUserList?: ApiUser[]; - deniedUserList?: ApiUser[]; + privacy: ApiInputPrivacyRules; }) { return invokeRequest(new GramJs.stories.EditStory({ id, - privacyRules: buildInputPrivacyRules(visibility, allowedUserList, deniedUserList), + privacyRules: buildInputPrivacyRules(privacy), }), { shouldReturnTrue: true, }); diff --git a/src/assets/font-icons/ask-support.svg b/src/assets/font-icons/ask-support.svg new file mode 100644 index 000000000..354a2b956 --- /dev/null +++ b/src/assets/font-icons/ask-support.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/font-icons/privacy-policy.svg b/src/assets/font-icons/privacy-policy.svg new file mode 100644 index 000000000..8d3adaec6 --- /dev/null +++ b/src/assets/font-icons/privacy-policy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/left/LeftColumn.tsx b/src/components/left/LeftColumn.tsx index 0de337df2..7da5e2bd5 100644 --- a/src/components/left/LeftColumn.tsx +++ b/src/components/left/LeftColumn.tsx @@ -182,8 +182,10 @@ function LeftColumn({ return; case SettingsScreens.PrivacyPhoneNumber: + case SettingsScreens.PrivacyAddByPhone: case SettingsScreens.PrivacyLastSeen: case SettingsScreens.PrivacyProfilePhoto: + case SettingsScreens.PrivacyBio: case SettingsScreens.PrivacyPhoneCall: case SettingsScreens.PrivacyPhoneP2P: case SettingsScreens.PrivacyForwarding: @@ -233,6 +235,10 @@ function LeftColumn({ case SettingsScreens.PrivacyProfilePhotoDeniedContacts: setSettingsScreen(SettingsScreens.PrivacyProfilePhoto); return; + case SettingsScreens.PrivacyBioAllowedContacts: + case SettingsScreens.PrivacyBioDeniedContacts: + setSettingsScreen(SettingsScreens.PrivacyBio); + return; case SettingsScreens.PrivacyPhoneCallAllowedContacts: case SettingsScreens.PrivacyPhoneCallDeniedContacts: setSettingsScreen(SettingsScreens.PrivacyPhoneCall); diff --git a/src/components/left/settings/Settings.scss b/src/components/left/settings/Settings.scss index daafcc465..4b592de02 100644 --- a/src/components/left/settings/Settings.scss +++ b/src/components/left/settings/Settings.scss @@ -106,8 +106,15 @@ } .settings-main-menu { - padding: 0 0.5rem 0.75rem; + padding: 0.5rem; background-color: var(--color-background); + box-shadow: inset 0 -0.0625rem 0 0 var(--color-background-secondary-accent); + border-bottom: 0.625rem solid var(--color-background-secondary); + + &:last-child { + border-bottom: none; + box-shadow: none; + } > .ChatExtra { padding: 0 0.5rem 0.3125rem; diff --git a/src/components/left/settings/Settings.tsx b/src/components/left/settings/Settings.tsx index 96bd70252..ba38ee981 100644 --- a/src/components/left/settings/Settings.tsx +++ b/src/components/left/settings/Settings.tsx @@ -99,6 +99,11 @@ const PRIVACY_PROFILE_PHOTO_SCREENS = [ SettingsScreens.PrivacyProfilePhotoDeniedContacts, ]; +const PRIVACY_BIO_SCREENS = [ + SettingsScreens.PrivacyBioAllowedContacts, + SettingsScreens.PrivacyBioDeniedContacts, +]; + const PRIVACY_PHONE_CALL_SCREENS = [ SettingsScreens.PrivacyPhoneCallAllowedContacts, SettingsScreens.PrivacyPhoneCallDeniedContacts, @@ -190,6 +195,7 @@ const Settings: FC = ({ [SettingsScreens.PrivacyPhoneNumber]: PRIVACY_PHONE_NUMBER_SCREENS.includes(screen), [SettingsScreens.PrivacyLastSeen]: PRIVACY_LAST_SEEN_PHONE_SCREENS.includes(screen), [SettingsScreens.PrivacyProfilePhoto]: PRIVACY_PROFILE_PHOTO_SCREENS.includes(screen), + [SettingsScreens.PrivacyBio]: PRIVACY_BIO_SCREENS.includes(screen), [SettingsScreens.PrivacyPhoneCall]: PRIVACY_PHONE_CALL_SCREENS.includes(screen), [SettingsScreens.PrivacyPhoneP2P]: PRIVACY_PHONE_P2P_SCREENS.includes(screen), [SettingsScreens.PrivacyForwarding]: PRIVACY_FORWARDING_SCREENS.includes(screen), @@ -314,8 +320,8 @@ const Settings: FC = ({ case SettingsScreens.PrivacyPhoneNumber: case SettingsScreens.PrivacyLastSeen: case SettingsScreens.PrivacyProfilePhoto: + case SettingsScreens.PrivacyBio: case SettingsScreens.PrivacyPhoneCall: - case SettingsScreens.PrivacyPhoneP2P: case SettingsScreens.PrivacyForwarding: case SettingsScreens.PrivacyVoiceMessages: case SettingsScreens.PrivacyGroupChats: @@ -331,6 +337,7 @@ const Settings: FC = ({ case SettingsScreens.PrivacyPhoneNumberAllowedContacts: case SettingsScreens.PrivacyLastSeenAllowedContacts: case SettingsScreens.PrivacyProfilePhotoAllowedContacts: + case SettingsScreens.PrivacyBioAllowedContacts: case SettingsScreens.PrivacyPhoneCallAllowedContacts: case SettingsScreens.PrivacyPhoneP2PAllowedContacts: case SettingsScreens.PrivacyForwardingAllowedContacts: @@ -349,6 +356,7 @@ const Settings: FC = ({ case SettingsScreens.PrivacyPhoneNumberDeniedContacts: case SettingsScreens.PrivacyLastSeenDeniedContacts: case SettingsScreens.PrivacyProfilePhotoDeniedContacts: + case SettingsScreens.PrivacyBioDeniedContacts: case SettingsScreens.PrivacyPhoneCallDeniedContacts: case SettingsScreens.PrivacyPhoneP2PDeniedContacts: case SettingsScreens.PrivacyForwardingDeniedContacts: diff --git a/src/components/left/settings/SettingsHeader.tsx b/src/components/left/settings/SettingsHeader.tsx index 82e62e20f..30ebb9390 100644 --- a/src/components/left/settings/SettingsHeader.tsx +++ b/src/components/left/settings/SettingsHeader.tsx @@ -113,20 +113,21 @@ const SettingsHeader: FC = ({ return

{lang('PrivacyLastSeen')}

; case SettingsScreens.PrivacyProfilePhoto: return

{lang('Privacy.ProfilePhoto')}

; + case SettingsScreens.PrivacyBio: + return

{lang('PrivacyBio')}

; case SettingsScreens.PrivacyForwarding: return

{lang('PrivacyForwards')}

; case SettingsScreens.PrivacyVoiceMessages: return

{lang('PrivacyVoiceMessages')}

; case SettingsScreens.PrivacyGroupChats: return

{lang('AutodownloadGroupChats')}

; - case SettingsScreens.PrivacyPhoneP2P: - return

{lang('PrivacyP2P')}

; case SettingsScreens.PrivacyPhoneCall: return

{lang('Calls')}

; case SettingsScreens.PrivacyPhoneNumberAllowedContacts: case SettingsScreens.PrivacyLastSeenAllowedContacts: case SettingsScreens.PrivacyProfilePhotoAllowedContacts: + case SettingsScreens.PrivacyBioAllowedContacts: case SettingsScreens.PrivacyForwardingAllowedContacts: case SettingsScreens.PrivacyVoiceMessagesAllowedContacts: case SettingsScreens.PrivacyGroupChatsAllowedContacts: @@ -136,6 +137,7 @@ const SettingsHeader: FC = ({ case SettingsScreens.PrivacyPhoneNumberDeniedContacts: case SettingsScreens.PrivacyLastSeenDeniedContacts: case SettingsScreens.PrivacyProfilePhotoDeniedContacts: + case SettingsScreens.PrivacyBioDeniedContacts: case SettingsScreens.PrivacyForwardingDeniedContacts: case SettingsScreens.PrivacyVoiceMessagesDeniedContacts: case SettingsScreens.PrivacyGroupChatsDeniedContacts: diff --git a/src/components/left/settings/SettingsMain.tsx b/src/components/left/settings/SettingsMain.tsx index efad7fae6..0371fdd14 100644 --- a/src/components/left/settings/SettingsMain.tsx +++ b/src/components/left/settings/SettingsMain.tsx @@ -4,14 +4,18 @@ import { getActions, withGlobal } from '../../../global'; import { SettingsScreens } from '../../../types'; +import { FAQ_URL, PRIVACY_URL } from '../../../config'; import { selectIsPremiumPurchaseBlocked } from '../../../global/selectors'; +import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; import useLang from '../../../hooks/useLang'; +import useLastCallback from '../../../hooks/useLastCallback'; import ChatExtra from '../../common/ChatExtra'; import PremiumIcon from '../../common/PremiumIcon'; import ProfileInfo from '../../common/ProfileInfo'; +import ConfirmDialog from '../../ui/ConfirmDialog'; import ListItem from '../../ui/ListItem'; type OwnProps = { @@ -38,8 +42,12 @@ const SettingsMain: FC = ({ loadProfilePhotos, loadAuthorizations, openPremiumModal, + openSupportChat, + openUrl, } = getActions(); + const [isSupportDialogOpen, openSupportDialog, closeSupportDialog] = useFlag(false); + const lang = useLang(); useEffect(() => { @@ -57,6 +65,11 @@ const SettingsMain: FC = ({ loadAuthorizations(); }, []); + const handleOpenSupport = useLastCallback(() => { + openSupportChat(); + closeSupportDialog(); + }); + return (
@@ -138,6 +151,8 @@ const SettingsMain: FC = ({ > {lang('StickersName')} +
+
{canBuyPremium && ( } @@ -149,6 +164,36 @@ const SettingsMain: FC = ({ )}
+
+ + {lang('AskAQuestion')} + + openUrl({ url: FAQ_URL })} + > + {lang('TelegramFaq')} + + openUrl({ url: PRIVACY_URL })} + > + {lang('PrivacyPolicy')} + +
+
); }; diff --git a/src/components/left/settings/SettingsPrivacy.tsx b/src/components/left/settings/SettingsPrivacy.tsx index 568005878..7be17e810 100644 --- a/src/components/left/settings/SettingsPrivacy.tsx +++ b/src/components/left/settings/SettingsPrivacy.tsx @@ -38,7 +38,7 @@ type StateProps = { privacyVoiceMessages?: ApiPrivacySettings; privacyGroupChats?: ApiPrivacySettings; privacyPhoneCall?: ApiPrivacySettings; - privacyPhoneP2P?: ApiPrivacySettings; + privacyBio?: ApiPrivacySettings; }; const SettingsPrivacy: FC = ({ @@ -53,6 +53,7 @@ const SettingsPrivacy: FC = ({ canDisplayAutoarchiveSetting, shouldArchiveAndMuteNewNonContact, canDisplayChatInTitle, + canSetPasscode, privacyPhoneNumber, privacyLastSeen, privacyProfilePhoto, @@ -60,10 +61,9 @@ const SettingsPrivacy: FC = ({ privacyVoiceMessages, privacyGroupChats, privacyPhoneCall, - privacyPhoneP2P, + privacyBio, onScreenSelect, onReset, - canSetPasscode, }) => { const { loadPrivacySettings, @@ -250,25 +250,12 @@ const SettingsPrivacy: FC = ({ narrow className="no-icon" // eslint-disable-next-line react/jsx-no-bind - onClick={() => onScreenSelect(SettingsScreens.PrivacyPhoneCall)} + onClick={() => onScreenSelect(SettingsScreens.PrivacyBio)} >
- {lang('WhoCanCallMe')} + {lang('PrivacyBio')} - {getVisibilityValue(privacyPhoneCall)} - -
- - onScreenSelect(SettingsScreens.PrivacyPhoneP2P)} - > -
- {lang('PrivacyP2P')} - - {getVisibilityValue(privacyPhoneP2P)} + {getVisibilityValue(privacyBio)}
@@ -287,16 +274,14 @@ const SettingsPrivacy: FC = ({ } className="no-icon" - onClick={handleVoiceMessagesClick} + // eslint-disable-next-line react/jsx-no-bind + onClick={() => onScreenSelect(SettingsScreens.PrivacyPhoneCall)} >
- {lang('PrivacyVoiceMessagesTitle')} + {lang('WhoCanCallMe')} - {getVisibilityValue(privacyVoiceMessages)} + {getVisibilityValue(privacyPhoneCall)}
@@ -313,6 +298,21 @@ const SettingsPrivacy: FC = ({ + } + className="no-icon" + onClick={handleVoiceMessagesClick} + > +
+ {lang('PrivacyVoiceMessagesTitle')} + + {getVisibilityValue(privacyVoiceMessages)} + +
+
{canDisplayAutoarchiveSetting && ( @@ -392,7 +392,7 @@ export default memo(withGlobal( privacyVoiceMessages: privacy.voiceMessages, privacyGroupChats: privacy.chatInvite, privacyPhoneCall: privacy.phoneCall, - privacyPhoneP2P: privacy.phoneP2P, + privacyBio: privacy.bio, canDisplayChatInTitle, canSetPasscode: selectCanSetPasscode(global), }; diff --git a/src/components/left/settings/SettingsPrivacyVisibility.tsx b/src/components/left/settings/SettingsPrivacyVisibility.tsx index 0e9167cc5..dee894146 100644 --- a/src/components/left/settings/SettingsPrivacyVisibility.tsx +++ b/src/components/left/settings/SettingsPrivacyVisibility.tsx @@ -2,7 +2,7 @@ import type { FC } from '../../../lib/teact/teact'; import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import type { ApiChat, ApiPhoto, ApiUser } from '../../../api/types'; +import type { ApiPhoto } from '../../../api/types'; import type { ApiPrivacySettings } from '../../../types'; import { SettingsScreens } from '../../../types'; @@ -11,6 +11,7 @@ import { getPrivacyKey } from './helpers/privacy'; import useHistoryBack from '../../../hooks/useHistoryBack'; import useLang from '../../../hooks/useLang'; +import useLastCallback from '../../../hooks/useLastCallback'; import ListItem from '../../ui/ListItem'; import RadioGroup from '../../ui/RadioGroup'; @@ -23,57 +24,131 @@ type OwnProps = { onReset: () => void; }; -type StateProps = - Partial & { - chatsById?: Record; - usersById?: Record; - currentUserId: string; - hasCurrentUserFullInfo?: boolean; - currentUserFallbackPhoto?: ApiPhoto; - }; +type StateProps = { + currentUserId: string; + hasCurrentUserFullInfo?: boolean; + currentUserFallbackPhoto?: ApiPhoto; + primaryPrivacy?: ApiPrivacySettings; + secondaryPrivacy?: ApiPrivacySettings; +}; const SettingsPrivacyVisibility: FC = ({ screen, isActive, - onScreenSelect, - onReset, - visibility, - allowUserIds, - allowChatIds, - blockUserIds, - blockChatIds, - chatsById, + primaryPrivacy, + secondaryPrivacy, currentUserId, hasCurrentUserFullInfo, currentUserFallbackPhoto, + onScreenSelect, + onReset, }) => { - const { setPrivacyVisibility } = getActions(); + useHistoryBack({ + isActive, + onBack: onReset, + }); + const secondaryScreen = useMemo(() => { + switch (screen) { + case SettingsScreens.PrivacyPhoneCall: + return SettingsScreens.PrivacyPhoneP2P; + case SettingsScreens.PrivacyPhoneNumber: { + return primaryPrivacy?.visibility === 'nobody' ? SettingsScreens.PrivacyAddByPhone : undefined; + } + default: + return undefined; + } + }, [primaryPrivacy, screen]); + + return ( +
+ + {screen === SettingsScreens.PrivacyProfilePhoto && primaryPrivacy?.visibility !== 'everybody' && ( + + )} + {secondaryScreen && ( + + )} +
+ ); +}; + +function PrivacySubsection({ + screen, + privacy, + onScreenSelect, +}: { + screen: SettingsScreens; + privacy?: ApiPrivacySettings; + onScreenSelect: (screen: SettingsScreens) => void; +}) { + const { setPrivacyVisibility } = getActions(); const lang = useLang(); const visibilityOptions = useMemo(() => { - return [ + const hasNobody = screen !== SettingsScreens.PrivacyAddByPhone; + const options = [ { value: 'everybody', label: lang('P2PEverybody') }, { value: 'contacts', label: lang('P2PContacts') }, - { value: 'nobody', label: lang('P2PNobody') }, ]; - }, [lang]); + if (hasNobody) { + options.push({ value: 'nobody', label: lang('P2PNobody') }); + } + return options; + }, [lang, screen]); - const exceptionLists = { - shouldShowDenied: visibility !== 'nobody', - shouldShowAllowed: visibility !== 'everybody', - }; + const primaryExceptionLists = useMemo(() => { + if (screen === SettingsScreens.PrivacyAddByPhone) { + return { + shouldShowDenied: false, + shouldShowAllowed: false, + }; + } + + return { + shouldShowDenied: privacy?.visibility !== 'nobody', + shouldShowAllowed: privacy?.visibility !== 'everybody', + }; + }, [privacy, screen]); const privacyKey = getPrivacyKey(screen); + const descriptionText = useMemo(() => { + switch (screen) { + case SettingsScreens.PrivacyLastSeen: + return lang('CustomHelp'); + case SettingsScreens.PrivacyAddByPhone: { + return privacy?.visibility === 'everybody' ? lang('PrivacyPhoneInfo') : lang('PrivacyPhoneInfo3'); + } + default: + return undefined; + } + }, [lang, screen, privacy]); + const headerText = useMemo(() => { switch (screen) { case SettingsScreens.PrivacyPhoneNumber: return lang('PrivacyPhoneTitle'); + case SettingsScreens.PrivacyAddByPhone: + return lang('PrivacyPhoneTitle2'); case SettingsScreens.PrivacyLastSeen: return lang('LastSeenTitle'); case SettingsScreens.PrivacyProfilePhoto: return lang('PrivacyProfilePhotoTitle'); + case SettingsScreens.PrivacyBio: + return lang('PrivacyBioTitle'); case SettingsScreens.PrivacyForwarding: return lang('PrivacyForwardsTitle'); case SettingsScreens.PrivacyVoiceMessages: @@ -89,19 +164,34 @@ const SettingsPrivacyVisibility: FC = ({ } }, [lang, screen]); - useHistoryBack({ - isActive, - onBack: onReset, + const prepareSubtitle = useLastCallback((userIds?: string[], chatIds?: string[]) => { + const userIdsCount = userIds?.length || 0; + const chatIdsCount = chatIds?.length || 0; + + if (!userIdsCount && !chatIdsCount) { + return lang('EditAdminAddUsers'); + } + + const userCountString = userIdsCount > 0 ? lang('Users', userIdsCount) : undefined; + const chatCountString = chatIdsCount > 0 ? lang('Chats', chatIdsCount) : undefined; + + return [userCountString, chatCountString].filter(Boolean).join(', '); }); - const descriptionText = useMemo(() => { - switch (screen) { - case SettingsScreens.PrivacyLastSeen: - return lang('CustomHelp'); - default: - return undefined; - } - }, [lang, screen]); + const allowedString = useMemo(() => { + return prepareSubtitle(privacy?.allowUserIds, privacy?.allowChatIds); + }, [privacy]); + + const blockString = useMemo(() => { + return prepareSubtitle(privacy?.blockUserIds, privacy?.blockChatIds); + }, [privacy]); + + const handleVisibilityChange = useCallback((value) => { + setPrivacyVisibility({ + privacyKey: privacyKey!, + visibility: value, + }); + }, [privacyKey]); const allowedContactsScreen = (() => { switch (screen) { @@ -111,6 +201,8 @@ const SettingsPrivacyVisibility: FC = ({ return SettingsScreens.PrivacyLastSeenAllowedContacts; case SettingsScreens.PrivacyProfilePhoto: return SettingsScreens.PrivacyProfilePhotoAllowedContacts; + case SettingsScreens.PrivacyBio: + return SettingsScreens.PrivacyBioAllowedContacts; case SettingsScreens.PrivacyForwarding: return SettingsScreens.PrivacyForwardingAllowedContacts; case SettingsScreens.PrivacyPhoneCall: @@ -132,6 +224,8 @@ const SettingsPrivacyVisibility: FC = ({ return SettingsScreens.PrivacyLastSeenDeniedContacts; case SettingsScreens.PrivacyProfilePhoto: return SettingsScreens.PrivacyProfilePhotoDeniedContacts; + case SettingsScreens.PrivacyBio: + return SettingsScreens.PrivacyBioDeniedContacts; case SettingsScreens.PrivacyForwarding: return SettingsScreens.PrivacyForwardingDeniedContacts; case SettingsScreens.PrivacyPhoneCall: @@ -145,105 +239,68 @@ const SettingsPrivacyVisibility: FC = ({ } })(); - const allowedCount = useMemo(() => { - if (!allowUserIds || !allowChatIds || !chatsById) { - return 0; - } - - return allowChatIds.reduce((result, chatId) => { - return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0); - }, allowUserIds.length); - }, [allowChatIds, allowUserIds, chatsById]); - - const blockCount = useMemo(() => { - if (!blockUserIds || !blockChatIds || !chatsById) { - return 0; - } - - return blockChatIds.reduce((result, chatId) => { - return result + (chatsById[chatId] ? chatsById[chatId].membersCount! : 0); - }, blockUserIds.length); - }, [blockChatIds, blockUserIds, chatsById]); - - const handleVisibilityChange = useCallback((value) => { - setPrivacyVisibility({ - privacyKey: privacyKey!, - visibility: value, - }); - }, [privacyKey, setPrivacyVisibility]); - return ( -
+ <>

{headerText}

- - {descriptionText && (

{descriptionText}

)}
- -
-

{lang('PrivacyExceptions')}

- - {exceptionLists.shouldShowAllowed && ( - { - onScreenSelect(allowedContactsScreen); - }} - > -
- {allowedCount > 0 && +{allowedCount}} - {lang('AlwaysAllow')} - {lang('EditAdminAddUsers')} -
-
- )} - {exceptionLists.shouldShowDenied && ( - { - onScreenSelect(deniedContactsScreen); - }} - > -
- {blockCount > 0 && −{blockCount}} - {lang('NeverAllow')} - {lang('EditAdminAddUsers')} -
-
- )} -
- - {screen === SettingsScreens.PrivacyProfilePhoto && exceptionLists.shouldShowAllowed && ( - + {(primaryExceptionLists.shouldShowAllowed || primaryExceptionLists.shouldShowDenied) && ( +
+

+ {lang('PrivacyExceptions')} +

+ {primaryExceptionLists.shouldShowAllowed && ( + { + onScreenSelect(allowedContactsScreen); + }} + > +
+ {lang('AlwaysAllow')} + {allowedString} +
+
+ )} + {primaryExceptionLists.shouldShowDenied && ( + { + onScreenSelect(deniedContactsScreen); + }} + > +
+ {lang('NeverAllow')} + {blockString} +
+
+ )} +
)} -
+ ); -}; +} export default memo(withGlobal( (global, { screen }): StateProps => { - let privacySettings: ApiPrivacySettings | undefined; + let primaryPrivacy: ApiPrivacySettings | undefined; + let secondaryPrivacy: ApiPrivacySettings | undefined; const { currentUserId, - chats: { byId: chatsById }, settings: { privacy }, } = global; @@ -251,39 +308,42 @@ export default memo(withGlobal( switch (screen) { case SettingsScreens.PrivacyPhoneNumber: - privacySettings = privacy.phoneNumber; + primaryPrivacy = privacy.phoneNumber; + secondaryPrivacy = privacy.addByPhone; break; case SettingsScreens.PrivacyLastSeen: - privacySettings = privacy.lastSeen; + primaryPrivacy = privacy.lastSeen; break; case SettingsScreens.PrivacyProfilePhoto: - privacySettings = privacy.profilePhoto; + primaryPrivacy = privacy.profilePhoto; break; - case SettingsScreens.PrivacyPhoneCall: - privacySettings = privacy.phoneCall; + case SettingsScreens.PrivacyBio: + primaryPrivacy = privacy.bio; break; case SettingsScreens.PrivacyPhoneP2P: - privacySettings = privacy.phoneP2P; + case SettingsScreens.PrivacyPhoneCall: + primaryPrivacy = privacy.phoneCall; + secondaryPrivacy = privacy.phoneP2P; break; case SettingsScreens.PrivacyForwarding: - privacySettings = privacy.forwards; + primaryPrivacy = privacy.forwards; break; case SettingsScreens.PrivacyVoiceMessages: - privacySettings = privacy.voiceMessages; + primaryPrivacy = privacy.voiceMessages; break; case SettingsScreens.PrivacyGroupChats: - privacySettings = privacy.chatInvite; + primaryPrivacy = privacy.chatInvite; break; } - if (!privacySettings) { + if (!primaryPrivacy) { return { currentUserId: currentUserId!, hasCurrentUserFullInfo: Boolean(currentUserFullInfo), @@ -292,8 +352,8 @@ export default memo(withGlobal( } return { - ...privacySettings, - chatsById, + primaryPrivacy, + secondaryPrivacy, currentUserId: currentUserId!, hasCurrentUserFullInfo: Boolean(currentUserFullInfo), currentUserFallbackPhoto: currentUserFullInfo?.fallbackPhoto, diff --git a/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx b/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx index bfb648ed9..1ba8d450c 100644 --- a/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx +++ b/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx @@ -1,6 +1,6 @@ import type { FC } from '../../../lib/teact/teact'; import React, { - memo, useCallback, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; @@ -9,7 +9,7 @@ import type { ApiPrivacySettings } from '../../../types'; import { SettingsScreens } from '../../../types'; import { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID } from '../../../config'; -import { filterChatsByName, isUserId } from '../../../global/helpers'; +import { filterChatsByName } from '../../../global/helpers'; import { unique } from '../../../util/iteratees'; import { getPrivacyKey } from './helpers/privacy'; @@ -37,10 +37,10 @@ const SettingsPrivacyVisibilityExceptionList: FC = ({ isAllowList, screen, isActive, - onScreenSelect, - onReset, currentUserId, settings, + onScreenSelect, + onReset, }) => { const { setPrivacySettings } = getActions(); @@ -61,6 +61,11 @@ const SettingsPrivacyVisibilityExceptionList: FC = ({ const [isSubmitShown, setIsSubmitShown] = useState(false); const [newSelectedContactIds, setNewSelectedContactIds] = useState(selectedContactIds); + // Reset selected contact ids on change from other client when screen is not active + useEffect(() => { + if (!isActive) setNewSelectedContactIds(selectedContactIds); + }, [isActive, selectedContactIds]); + const folderAllOrderedIds = useFolderManagerForOrderedIds(ALL_FOLDER_ID); const folderArchivedOrderedIds = useFolderManagerForOrderedIds(ARCHIVED_FOLDER_ID); const displayedIds = useMemo(() => { @@ -68,11 +73,7 @@ const SettingsPrivacyVisibilityExceptionList: FC = ({ const chatsById = getGlobal().chats.byId; const chatIds = unique([...folderAllOrderedIds || [], ...folderArchivedOrderedIds || []]) - .filter((chatId) => { - const chat = chatsById[chatId]; - - return chat && isUserId(chat.id) && chat.id !== currentUserId; - }); + .filter((chatId) => chatId !== currentUserId); return unique([ ...selectedContactIds, @@ -89,7 +90,7 @@ const SettingsPrivacyVisibilityExceptionList: FC = ({ setPrivacySettings({ privacyKey: getPrivacyKey(screen)!, isAllowList: Boolean(isAllowList), - contactsIds: newSelectedContactIds, + updatedIds: newSelectedContactIds, }); onScreenSelect(SettingsScreens.Privacy); @@ -136,6 +137,9 @@ function getCurrentPrivacySettings(global: GlobalState, screen: SettingsScreens) case SettingsScreens.PrivacyProfilePhotoAllowedContacts: case SettingsScreens.PrivacyProfilePhotoDeniedContacts: return privacy.profilePhoto; + case SettingsScreens.PrivacyBioAllowedContacts: + case SettingsScreens.PrivacyBioDeniedContacts: + return privacy.bio; case SettingsScreens.PrivacyPhoneCallAllowedContacts: case SettingsScreens.PrivacyPhoneCallDeniedContacts: return privacy.phoneCall; diff --git a/src/components/left/settings/helpers/privacy.ts b/src/components/left/settings/helpers/privacy.ts index 12bc6e2e6..6d455b327 100644 --- a/src/components/left/settings/helpers/privacy.ts +++ b/src/components/left/settings/helpers/privacy.ts @@ -15,6 +15,10 @@ export function getPrivacyKey(screen: SettingsScreens): ApiPrivacyKey | undefine case SettingsScreens.PrivacyProfilePhotoAllowedContacts: case SettingsScreens.PrivacyProfilePhotoDeniedContacts: return 'profilePhoto'; + case SettingsScreens.PrivacyBio: + case SettingsScreens.PrivacyBioAllowedContacts: + case SettingsScreens.PrivacyBioDeniedContacts: + return 'bio'; case SettingsScreens.PrivacyForwarding: case SettingsScreens.PrivacyForwardingAllowedContacts: case SettingsScreens.PrivacyForwardingDeniedContacts: @@ -35,6 +39,8 @@ export function getPrivacyKey(screen: SettingsScreens): ApiPrivacyKey | undefine case SettingsScreens.PrivacyPhoneP2PAllowedContacts: case SettingsScreens.PrivacyPhoneP2PDeniedContacts: return 'phoneP2P'; + case SettingsScreens.PrivacyAddByPhone: + return 'addByPhone'; } return undefined; diff --git a/src/components/story/Story.tsx b/src/components/story/Story.tsx index a3cea6249..6e206632a 100644 --- a/src/components/story/Story.tsx +++ b/src/components/story/Story.tsx @@ -439,12 +439,12 @@ function Story({ const handleInfoPrivacyClick = useLastCallback(() => { const visibility = !isLoadedStory || story.isPublic ? undefined - : story.isForContacts ? 'contacts' : (story.isForCloseFriends ? 'closeFriends' : 'selectedContacts'); + : story.isForContacts ? 'contacts' : (story.isForCloseFriends ? 'closeFriends' : 'nobody'); let message; const myName = getUserFirstOrLastName(user); switch (visibility) { - case 'selectedContacts': + case 'nobody': message = lang('StorySelectedContactsHint', myName); break; case 'contacts': @@ -560,7 +560,7 @@ function Story({ case 'closeFriends': privacyIcon = 'favorite-filled'; break; - case 'selectedContacts': + case 'nobody': privacyIcon = 'group-filled'; } } else { diff --git a/src/components/story/StorySettings.tsx b/src/components/story/StorySettings.tsx index 996ca407c..a0c3c6973 100644 --- a/src/components/story/StorySettings.tsx +++ b/src/components/story/StorySettings.tsx @@ -69,7 +69,7 @@ const OPTIONS: PrivacyOption[] = [{ actions: 'closeFriends', }, { name: 'StoryPrivacyOptionSelectedContacts', - value: 'selectedContacts', + value: 'nobody', color: ['#FFB743', '#F69A36'], icon: 'group-filled', actions: 'allowUserIds', diff --git a/src/config.ts b/src/config.ts index c3e40db49..ea42d037f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -293,6 +293,8 @@ export const DEFAULT_LANG_CODE = 'en'; export const DEFAULT_LANG_PACK = 'android'; export const LANG_PACKS = ['android', 'ios', 'tdesktop', 'macos'] as const; export const FEEDBACK_URL = 'https://bugs.telegram.org/?tag_ids=41&sort=time'; +export const FAQ_URL = 'https://telegram.org/faq'; +export const PRIVACY_URL = 'https://telegram.org/privacy'; export const MINI_APP_TOS_URL = 'https://telegram.org/tos/mini-apps'; export const GENERAL_TOPIC_ID = 1; export const STORY_EXPIRE_PERIOD = 86400; // 1 day diff --git a/src/global/actions/api/settings.ts b/src/global/actions/api/settings.ts index 022cb8309..d2ccc4fcb 100644 --- a/src/global/actions/api/settings.ts +++ b/src/global/actions/api/settings.ts @@ -1,9 +1,8 @@ import type { ApiUser, ApiUsername } from '../../../api/types'; import type { ApiPrivacySettings, - InputPrivacyContact, InputPrivacyRules, PrivacyVisibility, } from '../../../types'; -import type { ActionReturnType, GlobalState } from '../../types'; +import type { ActionReturnType } from '../../types'; import { ProfileEditProgress, UPLOADING_WALLPAPER_SLUG, @@ -17,7 +16,7 @@ import { requestPermission, subscribe, unsubscribe } from '../../../util/notific import requestActionTimeout from '../../../util/requestActionTimeout'; import { getServerTime } from '../../../util/serverTime'; import { callApi } from '../../../api/gramjs'; -import { isUserId } from '../../helpers'; +import { buildApiInputPrivacyRules } from '../../helpers'; import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { addBlockedUser, addNotifyExceptions, addUsers, removeBlockedUser, replaceSettings, updateChat, updateChats, @@ -413,6 +412,7 @@ addActionHandler('loadLanguages', async (global): Promise => { addActionHandler('loadPrivacySettings', async (global): Promise => { const result = await Promise.all([ callApi('fetchPrivacySettings', 'phoneNumber'), + callApi('fetchPrivacySettings', 'addByPhone'), callApi('fetchPrivacySettings', 'lastSeen'), callApi('fetchPrivacySettings', 'profilePhoto'), callApi('fetchPrivacySettings', 'forwards'), @@ -420,6 +420,7 @@ addActionHandler('loadPrivacySettings', async (global): Promise => { callApi('fetchPrivacySettings', 'phoneCall'), callApi('fetchPrivacySettings', 'phoneP2P'), callApi('fetchPrivacySettings', 'voiceMessages'), + callApi('fetchPrivacySettings', 'bio'), ]); if (result.some((e) => e === undefined)) { @@ -428,6 +429,7 @@ addActionHandler('loadPrivacySettings', async (global): Promise => { const [ phoneNumberSettings, + addByPhoneSettings, lastSeenSettings, profilePhotoSettings, forwardsSettings, @@ -435,6 +437,7 @@ addActionHandler('loadPrivacySettings', async (global): Promise => { phoneCallSettings, phoneP2PSettings, voiceMessagesSettings, + bioSettings, ] = result as { users: ApiUser[]; rules: ApiPrivacySettings; @@ -451,6 +454,7 @@ addActionHandler('loadPrivacySettings', async (global): Promise => { privacy: { ...global.settings.privacy, phoneNumber: phoneNumberSettings.rules, + addByPhone: addByPhoneSettings.rules, lastSeen: lastSeenSettings.rules, profilePhoto: profilePhotoSettings.rules, forwards: forwardsSettings.rules, @@ -458,6 +462,7 @@ addActionHandler('loadPrivacySettings', async (global): Promise => { phoneCall: phoneCallSettings.rules, phoneP2P: phoneP2PSettings.rules, voiceMessages: voiceMessagesSettings.rules, + bio: bioSettings.rules, }, }, }; @@ -475,10 +480,10 @@ addActionHandler('setPrivacyVisibility', async (global, actions, payload): Promi return; } - const rules = buildInputPrivacyRules(global, { + const rules = buildApiInputPrivacyRules(global, { visibility, allowedIds: [...settings.allowUserIds, ...settings.allowChatIds], - deniedIds: [...settings.blockUserIds, ...settings.blockChatIds], + blockedIds: [...settings.blockUserIds, ...settings.blockChatIds], }); const result = await callApi('setPrivacySettings', privacyKey, rules); @@ -502,7 +507,7 @@ addActionHandler('setPrivacyVisibility', async (global, actions, payload): Promi }); addActionHandler('setPrivacySettings', async (global, actions, payload): Promise => { - const { privacyKey, isAllowList, contactsIds } = payload!; + const { privacyKey, isAllowList, updatedIds } = payload!; const { privacy: { [privacyKey]: settings }, } = global.settings; @@ -511,10 +516,11 @@ addActionHandler('setPrivacySettings', async (global, actions, payload): Promise return; } - const rules = buildInputPrivacyRules(global, { + const rules = buildApiInputPrivacyRules(global, { visibility: settings.visibility, - allowedIds: isAllowList ? contactsIds : [...settings.allowUserIds, ...settings.allowChatIds], - deniedIds: !isAllowList ? contactsIds : [...settings.blockUserIds, ...settings.blockChatIds], + isUnspecified: settings.isUnspecified, + allowedIds: isAllowList ? updatedIds : [...settings.allowUserIds, ...settings.allowChatIds], + blockedIds: !isAllowList ? updatedIds : [...settings.blockUserIds, ...settings.blockChatIds], }); const result = await callApi('setPrivacySettings', privacyKey, rules); @@ -537,74 +543,6 @@ addActionHandler('setPrivacySettings', async (global, actions, payload): Promise setGlobal(global); }); -function buildInputPrivacyRules(global: GlobalState, { - visibility, - allowedIds, - deniedIds, -}: { - visibility: PrivacyVisibility; - allowedIds: string[]; - deniedIds: string[]; -}): InputPrivacyRules { - const { - users: { byId: usersById }, - chats: { byId: chatsById }, - } = global; - - const rules: InputPrivacyRules = { - visibility, - }; - let users: InputPrivacyContact[]; - let chats: InputPrivacyContact[]; - - const collectUsers = (userId: string) => { - if (!isUserId(userId)) { - return undefined; - } - const { id, accessHash } = usersById[userId] || {}; - if (!id) { - return undefined; - } - - return { id, accessHash }; - }; - - const collectChats = (userId: string) => { - if (isUserId(userId)) { - return undefined; - } - const chat = chatsById[userId]; - - return chat ? { id: chat.id } : undefined; - }; - - if (visibility === 'contacts' || visibility === 'nobody') { - users = allowedIds.map(collectUsers).filter(Boolean) as InputPrivacyContact[]; - chats = allowedIds.map(collectChats).filter(Boolean) as InputPrivacyContact[]; - - if (users.length > 0) { - rules.allowedUsers = users; - } - if (chats.length > 0) { - rules.allowedChats = chats; - } - } - - if (visibility === 'everybody' || visibility === 'contacts') { - users = deniedIds.map(collectUsers).filter(Boolean) as InputPrivacyContact[]; - chats = deniedIds.map(collectChats).filter(Boolean) as InputPrivacyContact[]; - - if (users.length > 0) { - rules.blockedUsers = users; - } - if (chats.length > 0) { - rules.blockedChats = chats; - } - } - - return rules; -} - addActionHandler('updateIsOnline', (global, actions, payload): ActionReturnType => { if (global.connectionState !== 'connectionStateReady') return; callApi('updateIsOnline', payload); diff --git a/src/global/actions/api/stories.ts b/src/global/actions/api/stories.ts index fe90baa18..6799a4fc9 100644 --- a/src/global/actions/api/stories.ts +++ b/src/global/actions/api/stories.ts @@ -6,7 +6,7 @@ import { buildCollectionByKey } from '../../../util/iteratees'; import { translate } from '../../../util/langProvider'; import { getServerTime } from '../../../util/serverTime'; import { callApi } from '../../../api/gramjs'; -import { getStoryKey } from '../../helpers'; +import { buildApiInputPrivacyRules, getStoryKey } from '../../helpers'; import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { addStories, @@ -378,13 +378,19 @@ addActionHandler('editStoryPrivacy', (global, actions, payload): ActionReturnTyp privacy, } = payload; - const allowedUserList = privacy.allowUserIds?.map((userId) => selectUser(global, userId)).filter(Boolean); - const deniedUserList = privacy.blockUserIds?.map((userId) => selectUser(global, userId)).filter(Boolean); + const allowedIds = [...privacy.allowUserIds, ...privacy.allowChatIds]; + const blockedIds = [...privacy.blockUserIds, ...privacy.blockChatIds]; + + const inputPrivacy = buildApiInputPrivacyRules(global, { + visibility: privacy.visibility, + isUnspecified: privacy.isUnspecified, + allowedIds, + blockedIds, + }); + void callApi('editStoryPrivacy', { id: storyId, - visibility: privacy.visibility, - allowedUserList, - deniedUserList, + privacy: inputPrivacy, }); }); diff --git a/src/global/helpers/index.ts b/src/global/helpers/index.ts index aaee192a7..f9c672caf 100644 --- a/src/global/helpers/index.ts +++ b/src/global/helpers/index.ts @@ -9,3 +9,4 @@ export * from './reactions'; export * from './bots'; export * from './media'; export * from './symbols'; +export * from './misc'; diff --git a/src/global/helpers/misc.ts b/src/global/helpers/misc.ts new file mode 100644 index 000000000..27d0f3aba --- /dev/null +++ b/src/global/helpers/misc.ts @@ -0,0 +1,36 @@ +import type { ApiInputPrivacyRules, PrivacyVisibility } from '../../types'; +import type { GlobalState } from '../types'; + +import { partition } from '../../util/iteratees'; +import { isUserId } from './chats'; + +export function buildApiInputPrivacyRules(global: GlobalState, { + visibility, + isUnspecified, + allowedIds, + blockedIds, +}: { + visibility: PrivacyVisibility; + isUnspecified?: boolean; + allowedIds: string[]; + blockedIds: string[]; +}): ApiInputPrivacyRules { + const { + users: { byId: usersById }, + chats: { byId: chatsById }, + } = global; + + const [allowedUserIds, allowedChatIds] = partition(allowedIds, isUserId); + const [blockedUserIds, blockedChatIds] = partition(blockedIds, isUserId); + + const rules: ApiInputPrivacyRules = { + visibility, + isUnspecified, + allowedUsers: allowedUserIds.map((userId) => usersById[userId]).filter(Boolean), + allowedChats: allowedChatIds.map((chatId) => chatsById[chatId]).filter(Boolean), + blockedUsers: blockedUserIds.map((userId) => usersById[userId]).filter(Boolean), + blockedChats: blockedChatIds.map((chatId) => chatsById[chatId]).filter(Boolean), + }; + + return rules; +} diff --git a/src/global/types.ts b/src/global/types.ts index 0e42f74ec..48a4ba44e 100644 --- a/src/global/types.ts +++ b/src/global/types.ts @@ -1064,7 +1064,7 @@ export interface ActionPayloads { setPrivacySettings: { privacyKey: ApiPrivacyKey; isAllowList: boolean; - contactsIds: string[]; + updatedIds: string[]; }; loadNotificationExceptions: undefined; setThemeSettings: { theme: ThemeKey } & Partial; diff --git a/src/styles/Telegram T.json b/src/styles/Telegram T.json index a9c0aadbf..87711972e 100644 --- a/src/styles/Telegram T.json +++ b/src/styles/Telegram T.json @@ -2,11 +2,49 @@ "metadata": { "name": "Telegram T", "lastOpened": 0, - "created": 1692722562593 + "created": 1694397528170 }, "iconSets": [ { "icons": [ + { + "id": 224, + "paths": [ + "M683.643 330.395c7.196-6.903 19.833-12.5 28.625-13.727l0.555-0.032 0.169-0.001c9.089 0.125 21.844 4.459 29.676 10.288l0.435 0.333 0.231 0.235 0.161 0.16 0.032 0.033c6.259 6.445 11.748 17.54 13.397 25.365l0.077 0.544 0.013 0.173 0.005 0.063c0.535 8.263-2.337 20.463-6.295 27.901l-0.529 0.795-0.065 0.091-0.044 0.060-0.124 0.165-3.127 4.12-247.479 282.773c-6.767 6.552-18.301 12.064-26.484 13.556l-0.504 0.084-0.091 0.004-0.385 0.011c-8.555 0.288-20.853-3.076-28.415-7.64l-0.927-0.68-0.175-0.144-0.077-0.065-0.233-0.199-4.067-3.533-106.337-106.367c-6.295-7.301-11.868-19.772-11.868-29.407 0-9.749 6.035-22.628 12.284-29.829l0.339-0.38 0.248-0.217 0.045-0.041 0.127-0.113c6.853-5.828 18.297-10.576 26.211-11.703l0.453-0.039 0.199-0.008 0.115-0.001c8.315 0.016 20.361 3.735 27.48 8.167l0.125 0.076 0.109 0.089 0.539 0.421 0.269 0.227 3.889 3.397 73.728 73.731 217.688-248.736z", + "M930.568 265.299l-0.001-0.66-0.003-0.66h0.064l-0.052-2.715-0.053-2.715-0.007-0.649-0.008-0.648-0.024-2.185-0.025-2.184-0.107-0.040-0.108-0.040-0.069-0.843c-0.769-9.211-2.688-18.473-5.632-27.333-2.944-8.859-6.915-17.315-11.789-24.908-5.649-8.281-12.715-15.927-20.621-22.42-7.907-6.492-16.655-11.832-25.671-15.499l-320.159-123.612c-5.092-1.909-10.615-3.456-16.229-4.527-5.616-1.069-11.324-1.661-16.788-1.661-5.449 0-11.101 0.572-16.667 1.623-5.567 1.051-11.048 2.579-16.159 4.489l-320.024 123.561c-8.969 3.628-17.699 8.849-25.612 15.252s-15.012 13.989-20.723 22.349c-5.403 8.421-9.791 18.037-12.891 28.129-3.1 10.091-4.911 20.659-5.161 30.985-0.291 25.539 0.544 72.192 7.275 130.484s19.356 128.223 42.644 200.319c13.613 41.796 29.944 81.403 48.749 118.345 18.804 36.943 40.081 71.221 63.588 102.36 29.013 38.195 61.861 72.241 98.035 101.719 36.172 29.477 75.668 54.384 117.973 74.303 5.927 2.692 12.405 4.879 19.035 6.393 6.629 1.513 13.409 2.355 19.936 2.355 6.495 0 13.189-0.803 19.756-2.284s13.004-3.643 18.983-6.36c42.296-19.911 81.843-44.839 118.071-74.336s69.136-63.567 98.155-101.764c23.505-31.137 44.785-65.417 63.593-102.361 18.807-36.945 35.141-76.555 48.757-118.351 22.331-69.131 34.859-136.244 41.787-193.008 6.927-56.764 8.255-103.177 8.183-130.904zM517.939 901.548l-1.115 0.579-1.1 0.44-0.199 0.019-0.323 0.029c-0.211 0.017-0.443 0.023-0.745 0.024-0.304 0-0.677-0.003-1.172-0.003-0.756 0-1.307-0.021-1.901-0.156-0.593-0.135-1.231-0.383-2.155-0.835-79.007-36.481-138.599-89.059-183.788-149.032s-75.975-127.344-97.369-193.412c-21.499-65.823-32.92-129.731-38.903-182.741-5.984-53.012-6.531-95.128-6.279-117.364v-0.055l0.001-0.053-0.005-0.021 0.009-0.003 0.011-0.003c-0.131-0.611-0.045-1.281 0.025-1.944s0.125-1.316 0.397-1.888c0.256-0.473 0.332-0.989 0.725-1.589 0.393-0.601 0.152-0.312 0.661-1.123 0 0 0.541-0.697 0.58-0.831 0.039-0.135 0.504-0.637 0.567-0.801 0.169-0.279 0.431-0.503 0.683-0.747s0.611-0.576 0.743-0.647c0.005-0.003 2.405-1.068 3.213-1.377l319.648-123.528c0 0 2.212-0.679 2.453-0.675 0.24 0.004 1.791 0.227 2.288 0.319s1.028 0.263 1.809 0.579l320.619 123.765 1.417-0.087 0.208 0.349 0.209 0.349 0.161 0.272 0.163 0.272c0.327 0.373 0.683 0.848 1.095 1.429 0.412 0.58 0.881 1.265 1.437 2.060 0.345 0.339 0.681 0.749 0.964 1.231s0.512 1.035 0.647 1.659c0.061 0.461 0.079 0.992 0.080 1.635s-0.013 1.397-0.015 2.307c0.251 22.253-0.304 64.167-6.293 116.972-5.989 52.804-17.412 116.5-38.899 182.317-21.335 65.879-52.119 133.097-97.215 192.988-45.096 59.889-104.445 112.581-183.025 149.149l-0.315 0.171z" + ], + "attrs": [ + {}, + {} + ], + "grid": 24, + "tags": [ + "privacy-policy" + ], + "isMulticolor": false, + "isMulticolor2": false + }, + { + "id": 223, + "paths": [ + "M512 42.667c-257.449 0-469.333 192.199-469.333 433.659l0.221 13.895c3.701 115.213 53.485 216.033 140.585 292.181l6.349 5.355-3.088 4.267-7.117 8.461-19.641 21.936c-12.635 14.884-20.341 26.863-24.672 47.725-9.621 46.371 16.329 86.028 54.672 102.076 41.869 17.524 126.555 9.82 181.919-21.16l12.725-7.395c16.319-9.861 30.227-19.821 43.819-30.981l9.533-8.108 16.748 2.207c18.905 2.127 38.024 3.2 57.279 3.2 257.449 0 469.333-192.199 469.333-433.659s-211.884-433.657-469.333-433.657zM512 128c212.077 0 384 155.949 384 348.325s-171.923 348.325-384 348.325c-32.515 0-64.087-3.667-94.237-10.565-3.6-0.824-7.509 1.251-12.621 5.399l-8.683 7.675-11.161 10.167-9.149 7.857-10.748 8.507c-9.677 7.309-21.231 15.103-35.173 22.905-40.955 22.919-97.699 20.929-107.303 16.911-6.559-2.745-4.849-7.423 1.188-14.761l8.411-9.419 7.020-7.643 7.719-8.812c5.297-6.28 10.815-13.385 16.060-21.408 24.913-38.107 14.619-83.475 3.443-91.639-87.4-63.847-138.763-153.783-138.763-263.499 0-192.375 171.923-348.325 384-348.325z", + "M362.667 469.333c0 35.346-28.654 64-64 64s-64-28.654-64-64c0-35.346 28.654-64 64-64s64 28.654 64 64z", + "M576 469.333c0 35.346-28.654 64-64 64s-64-28.654-64-64c0-35.346 28.654-64 64-64s64 28.654 64 64z", + "M789.333 469.333c0 35.346-28.654 64-64 64s-64-28.654-64-64c0-35.346 28.654-64 64-64s64 28.654 64 64z" + ], + "attrs": [ + {}, + {}, + {}, + {} + ], + "isMulticolor": false, + "isMulticolor2": false, + "grid": 24, + "tags": [ + "ask-support" + ] + }, { "id": 221, "paths": [ @@ -3536,8 +3574,8 @@ "metadata": { "name": "icons", "importSize": { - "width": 24, - "height": 24 + "width": 768, + "height": 768 } }, "preferences": { @@ -3578,13 +3616,29 @@ "showGrid": true }, "selection": [ + { + "order": 1314, + "id": 190, + "name": "privacy-policy", + "prevSize": 32, + "code": 59863, + "tempChar": "" + }, + { + "order": 1313, + "id": 189, + "name": "ask-support", + "prevSize": 32, + "code": 59864, + "tempChar": "" + }, { "order": 1309, "id": 187, "name": "eye-outline", "prevSize": 32, "code": 59855, - "tempChar": "" + "tempChar": "" }, { "order": 1308, @@ -3592,7 +3646,7 @@ "name": "eye-closed-outline", "prevSize": 32, "code": 59859, - "tempChar": "" + "tempChar": "" }, { "order": 1307, @@ -3600,7 +3654,7 @@ "name": "story-caption", "prevSize": 32, "code": 59860, - "tempChar": "" + "tempChar": "" }, { "order": 1306, @@ -3608,7 +3662,7 @@ "name": "story-priority", "prevSize": 32, "code": 59854, - "tempChar": "" + "tempChar": "" }, { "order": 1302, @@ -3616,7 +3670,7 @@ "name": "stealth-past", "prevSize": 32, "code": 59856, - "tempChar": "" + "tempChar": "" }, { "order": 1301, @@ -3624,7 +3678,7 @@ "name": "stealth-future", "prevSize": 32, "code": 59857, - "tempChar": "" + "tempChar": "" }, { "order": 1303, @@ -3632,7 +3686,7 @@ "name": "timer", "prevSize": 32, "code": 59858, - "tempChar": "" + "tempChar": "" }, { "order": 1298, @@ -3640,7 +3694,7 @@ "name": "arrow-down-circle", "prevSize": 32, "code": 59861, - "tempChar": "" + "tempChar": "" }, { "order": 1297, @@ -3648,7 +3702,7 @@ "name": "story-reply", "prevSize": 32, "code": 59862, - "tempChar": "" + "tempChar": "" }, { "order": 1091, @@ -3656,7 +3710,7 @@ "prevSize": 32, "id": 168, "code": 59788, - "tempChar": "" + "tempChar": "" }, { "order": 1092, @@ -3664,7 +3718,7 @@ "prevSize": 32, "id": 169, "code": 59789, - "tempChar": "" + "tempChar": "" }, { "order": 1093, @@ -3672,7 +3726,7 @@ "prevSize": 32, "id": 170, "code": 59790, - "tempChar": "" + "tempChar": "" }, { "order": 1094, @@ -3680,7 +3734,7 @@ "prevSize": 32, "id": 171, "code": 59791, - "tempChar": "" + "tempChar": "" }, { "order": 1095, @@ -3688,7 +3742,7 @@ "prevSize": 32, "id": 172, "code": 59792, - "tempChar": "" + "tempChar": "" }, { "order": 1096, @@ -3696,7 +3750,7 @@ "prevSize": 32, "id": 173, "code": 59793, - "tempChar": "" + "tempChar": "" }, { "order": 1097, @@ -3704,7 +3758,7 @@ "name": "hand-stop", "prevSize": 32, "code": 59847, - "tempChar": "" + "tempChar": "" }, { "order": 1098, @@ -3712,7 +3766,7 @@ "name": "more-circle", "prevSize": 32, "code": 59848, - "tempChar": "" + "tempChar": "" }, { "order": 1099, @@ -3720,7 +3774,7 @@ "name": "close-circle", "prevSize": 32, "code": 59849, - "tempChar": "" + "tempChar": "" }, { "order": 1100, @@ -3728,7 +3782,7 @@ "name": "play-story", "prevSize": 32, "code": 59846, - "tempChar": "" + "tempChar": "" }, { "order": 1101, @@ -3736,7 +3790,7 @@ "name": "story-expired", "prevSize": 32, "code": 59845, - "tempChar": "" + "tempChar": "" }, { "order": 1102, @@ -3744,7 +3798,7 @@ "name": "save-story", "prevSize": 32, "code": 59843, - "tempChar": "" + "tempChar": "" }, { "order": 1103, @@ -3752,7 +3806,7 @@ "name": "settings-filled", "prevSize": 32, "code": 59841, - "tempChar": "" + "tempChar": "" }, { "order": 1104, @@ -3760,7 +3814,7 @@ "name": "share-screen-stop", "prevSize": 32, "code": 59842, - "tempChar": "" + "tempChar": "" }, { "order": 1105, @@ -3768,7 +3822,7 @@ "name": "user-online", "prevSize": 32, "code": 59840, - "tempChar": "" + "tempChar": "" }, { "order": 1106, @@ -3776,7 +3830,7 @@ "name": "forums", "prevSize": 32, "code": 59828, - "tempChar": "" + "tempChar": "" }, { "order": 1107, @@ -3784,7 +3838,7 @@ "name": "hashtag", "prevSize": 32, "code": 59825, - "tempChar": "" + "tempChar": "" }, { "order": 1108, @@ -3792,7 +3846,7 @@ "name": "reopen-topic", "prevSize": 32, "code": 59826, - "tempChar": "" + "tempChar": "" }, { "order": 1109, @@ -3800,7 +3854,7 @@ "name": "close-topic", "prevSize": 32, "code": 59827, - "tempChar": "" + "tempChar": "" }, { "order": 1110, @@ -3808,7 +3862,7 @@ "name": "open-in-new-tab", "prevSize": 32, "code": 59823, - "tempChar": "" + "tempChar": "" }, { "order": 1111, @@ -3816,7 +3870,7 @@ "name": "pip", "prevSize": 32, "code": 59822, - "tempChar": "" + "tempChar": "" }, { "order": 1112, @@ -3824,7 +3878,7 @@ "name": "gift", "prevSize": 32, "code": 59821, - "tempChar": "" + "tempChar": "" }, { "order": 1113, @@ -3832,7 +3886,7 @@ "name": "sort", "prevSize": 32, "code": 59820, - "tempChar": "" + "tempChar": "" }, { "order": 1114, @@ -3840,7 +3894,7 @@ "name": "web", "prevSize": 32, "code": 59819, - "tempChar": "" + "tempChar": "" }, { "order": 1115, @@ -3848,7 +3902,7 @@ "name": "transcribe", "prevSize": 32, "code": 59818, - "tempChar": "" + "tempChar": "" }, { "order": 1116, @@ -3856,7 +3910,7 @@ "name": "add-one-badge", "prevSize": 32, "code": 59803, - "tempChar": "" + "tempChar": "" }, { "order": 1117, @@ -3864,7 +3918,7 @@ "name": "double-badge", "prevSize": 32, "code": 59810, - "tempChar": "" + "tempChar": "" }, { "order": 1118, @@ -3872,7 +3926,7 @@ "name": "file-badge", "prevSize": 32, "code": 59811, - "tempChar": "" + "tempChar": "" }, { "order": 1119, @@ -3880,7 +3934,7 @@ "name": "folder-badge", "prevSize": 32, "code": 59812, - "tempChar": "" + "tempChar": "" }, { "order": 1120, @@ -3888,7 +3942,7 @@ "name": "link-badge", "prevSize": 32, "code": 59813, - "tempChar": "" + "tempChar": "" }, { "order": 1121, @@ -3896,7 +3950,7 @@ "name": "premium", "prevSize": 32, "code": 59815, - "tempChar": "" + "tempChar": "" }, { "order": 1122, @@ -3904,7 +3958,7 @@ "name": "heart-outline", "prevSize": 32, "code": 59806, - "tempChar": "" + "tempChar": "" }, { "order": 1123, @@ -3912,7 +3966,7 @@ "name": "heart", "prevSize": 32, "code": 59807, - "tempChar": "" + "tempChar": "" }, { "order": 1124, @@ -3920,7 +3974,7 @@ "name": "word-wrap", "prevSize": 32, "code": 59805, - "tempChar": "" + "tempChar": "" }, { "order": 1125, @@ -3928,7 +3982,7 @@ "name": "webapp", "prevSize": 32, "code": 59795, - "tempChar": "" + "tempChar": "" }, { "order": 1126, @@ -3936,7 +3990,7 @@ "name": "reload", "prevSize": 32, "code": 59796, - "tempChar": "" + "tempChar": "" }, { "order": 1127, @@ -3944,7 +3998,7 @@ "name": "install", "prevSize": 32, "code": 59801, - "tempChar": "" + "tempChar": "" }, { "order": 1128, @@ -3952,7 +4006,7 @@ "name": "favorite-filled", "prevSize": 32, "code": 59800, - "tempChar": "" + "tempChar": "" }, { "order": 1129, @@ -3960,7 +4014,7 @@ "name": "video-outlined", "prevSize": 32, "code": 59799, - "tempChar": "" + "tempChar": "" }, { "order": 1130, @@ -3968,7 +4022,7 @@ "name": "stats", "prevSize": 32, "code": 59798, - "tempChar": "" + "tempChar": "" }, { "order": 1131, @@ -3976,7 +4030,7 @@ "name": "copy-media", "prevSize": 32, "code": 59797, - "tempChar": "" + "tempChar": "" }, { "order": 1132, @@ -3984,7 +4038,7 @@ "name": "sidebar", "prevSize": 32, "code": 59794, - "tempChar": "" + "tempChar": "" }, { "order": 1133, @@ -3992,7 +4046,7 @@ "name": "microphone", "prevSize": 32, "code": 59701, - "tempChar": "" + "tempChar": "" }, { "order": 1134, @@ -4000,7 +4054,7 @@ "name": "microphone-alt", "prevSize": 32, "code": 59707, - "tempChar": "" + "tempChar": "" }, { "order": 1135, @@ -4008,7 +4062,7 @@ "name": "camera-add", "prevSize": 32, "code": 59663, - "tempChar": "" + "tempChar": "" }, { "order": 1136, @@ -4016,7 +4070,7 @@ "name": "camera", "prevSize": 32, "code": 59662, - "tempChar": "" + "tempChar": "" }, { "order": 1137, @@ -4024,7 +4078,7 @@ "name": "video-stop", "prevSize": 32, "code": 59787, - "tempChar": "" + "tempChar": "" }, { "order": 1138, @@ -4032,7 +4086,7 @@ "name": "speaker-muted-story", "prevSize": 32, "code": 59850, - "tempChar": "" + "tempChar": "" }, { "order": 1139, @@ -4040,7 +4094,7 @@ "name": "speaker-story", "prevSize": 32, "code": 59844, - "tempChar": "" + "tempChar": "" }, { "order": 1140, @@ -4048,7 +4102,7 @@ "name": "speaker", "prevSize": 32, "code": 59777, - "tempChar": "" + "tempChar": "" }, { "order": 1141, @@ -4056,7 +4110,7 @@ "name": "speaker-outline", "prevSize": 32, "code": 59778, - "tempChar": "" + "tempChar": "" }, { "order": 1142, @@ -4064,7 +4118,7 @@ "name": "phone-discard-outline", "prevSize": 32, "code": 59779, - "tempChar": "" + "tempChar": "" }, { "order": 1143, @@ -4072,7 +4126,7 @@ "name": "allow-speak", "prevSize": 32, "code": 59780, - "tempChar": "" + "tempChar": "" }, { "order": 1144, @@ -4080,7 +4134,7 @@ "name": "stop-raising-hand", "prevSize": 32, "code": 59781, - "tempChar": "" + "tempChar": "" }, { "order": 1145, @@ -4088,7 +4142,7 @@ "name": "voice-chat", "prevSize": 32, "code": 59783, - "tempChar": "" + "tempChar": "" }, { "order": 1146, @@ -4096,7 +4150,7 @@ "name": "video", "prevSize": 32, "code": 59784, - "tempChar": "" + "tempChar": "" }, { "order": 1147, @@ -4104,7 +4158,7 @@ "name": "noise-suppression", "prevSize": 32, "code": 59785, - "tempChar": "" + "tempChar": "" }, { "order": 1148, @@ -4112,7 +4166,7 @@ "name": "phone-discard", "prevSize": 32, "code": 59786, - "tempChar": "" + "tempChar": "" }, { "order": 1149, @@ -4120,7 +4174,7 @@ "name": "bot-commands-filled", "prevSize": 32, "code": 59775, - "tempChar": "" + "tempChar": "" }, { "order": 1150, @@ -4128,7 +4182,7 @@ "name": "reply-filled", "prevSize": 32, "code": 59776, - "tempChar": "" + "tempChar": "" }, { "order": 1151, @@ -4136,7 +4190,7 @@ "name": "bug", "prevSize": 32, "code": 59774, - "tempChar": "" + "tempChar": "" }, { "order": 1152, @@ -4144,7 +4198,7 @@ "name": "data", "prevSize": 32, "code": 59773, - "tempChar": "" + "tempChar": "" }, { "order": 1153, @@ -4152,7 +4206,7 @@ "name": "darkmode", "prevSize": 32, "code": 59769, - "tempChar": "" + "tempChar": "" }, { "order": 1154, @@ -4160,7 +4214,7 @@ "name": "animations", "prevSize": 32, "code": 59804, - "tempChar": "" + "tempChar": "" }, { "order": 1155, @@ -4168,7 +4222,7 @@ "name": "enter", "prevSize": 32, "code": 59771, - "tempChar": "" + "tempChar": "" }, { "order": 1156, @@ -4176,7 +4230,7 @@ "name": "fontsize", "prevSize": 32, "code": 59772, - "tempChar": "" + "tempChar": "" }, { "order": 1157, @@ -4184,7 +4238,7 @@ "name": "permissions", "prevSize": 32, "code": 59766, - "tempChar": "" + "tempChar": "" }, { "order": 1158, @@ -4192,7 +4246,7 @@ "name": "card", "prevSize": 32, "code": 59767, - "tempChar": "" + "tempChar": "" }, { "order": 1159, @@ -4200,7 +4254,7 @@ "name": "truck", "prevSize": 32, "code": 59768, - "tempChar": "" + "tempChar": "" }, { "order": 1160, @@ -4208,7 +4262,7 @@ "name": "share-filled", "prevSize": 32, "code": 59738, - "tempChar": "" + "tempChar": "" }, { "order": 1161, @@ -4216,7 +4270,7 @@ "name": "bold", "prevSize": 32, "code": 59745, - "tempChar": "" + "tempChar": "" }, { "order": 1162, @@ -4224,7 +4278,7 @@ "name": "bot-command", "prevSize": 32, "code": 59746, - "tempChar": "" + "tempChar": "" }, { "order": 1163, @@ -4232,7 +4286,7 @@ "name": "calendar-filter", "prevSize": 32, "code": 59747, - "tempChar": "" + "tempChar": "" }, { "order": 1164, @@ -4240,7 +4294,7 @@ "name": "arrow-down", "prevSize": 32, "code": 59750, - "tempChar": "" + "tempChar": "" }, { "order": 1165, @@ -4248,7 +4302,7 @@ "name": "email", "prevSize": 32, "code": 59751, - "tempChar": "" + "tempChar": "" }, { "order": 1166, @@ -4256,7 +4310,7 @@ "name": "italic", "prevSize": 32, "code": 59752, - "tempChar": "" + "tempChar": "" }, { "order": 1167, @@ -4264,7 +4318,7 @@ "name": "link", "prevSize": 32, "code": 59753, - "tempChar": "" + "tempChar": "" }, { "order": 1168, @@ -4272,7 +4326,7 @@ "name": "link-broken", "prevSize": 32, "code": 59824, - "tempChar": "" + "tempChar": "" }, { "order": 1169, @@ -4280,7 +4334,7 @@ "name": "mention", "prevSize": 32, "code": 59754, - "tempChar": "" + "tempChar": "" }, { "order": 1170, @@ -4288,7 +4342,7 @@ "name": "monospace", "prevSize": 32, "code": 59755, - "tempChar": "" + "tempChar": "" }, { "order": 1171, @@ -4296,7 +4350,7 @@ "name": "password-off", "prevSize": 32, "code": 59757, - "tempChar": "" + "tempChar": "" }, { "order": 1172, @@ -4304,7 +4358,7 @@ "name": "pin-list", "prevSize": 32, "code": 59758, - "tempChar": "" + "tempChar": "" }, { "order": 1173, @@ -4312,7 +4366,7 @@ "name": "replace", "prevSize": 32, "code": 59760, - "tempChar": "" + "tempChar": "" }, { "order": 1174, @@ -4320,7 +4374,7 @@ "name": "schedule", "prevSize": 32, "code": 59761, - "tempChar": "" + "tempChar": "" }, { "order": 1175, @@ -4328,7 +4382,7 @@ "name": "strikethrough", "prevSize": 32, "code": 59762, - "tempChar": "" + "tempChar": "" }, { "order": 1176, @@ -4336,7 +4390,7 @@ "name": "underlined", "prevSize": 32, "code": 59763, - "tempChar": "" + "tempChar": "" }, { "order": 1177, @@ -4344,7 +4398,7 @@ "name": "zoom-out", "prevSize": 32, "code": 59765, - "tempChar": "" + "tempChar": "" }, { "order": 1178, @@ -4352,7 +4406,7 @@ "name": "zoom-in", "prevSize": 32, "code": 59764, - "tempChar": "" + "tempChar": "" }, { "order": 1179, @@ -4360,7 +4414,7 @@ "name": "spoiler-disable", "prevSize": 32, "code": 59829, - "tempChar": "" + "tempChar": "" }, { "order": 1180, @@ -4368,7 +4422,7 @@ "name": "grouped", "prevSize": 32, "code": 59830, - "tempChar": "" + "tempChar": "" }, { "order": 1181, @@ -4376,7 +4430,7 @@ "name": "grouped-disable", "prevSize": 32, "code": 59831, - "tempChar": "" + "tempChar": "" }, { "order": 1182, @@ -4384,7 +4438,7 @@ "name": "spoiler", "prevSize": 32, "code": 59832, - "tempChar": "" + "tempChar": "" }, { "order": 1183, @@ -4392,7 +4446,7 @@ "name": "select", "prevSize": 32, "code": 59744, - "tempChar": "" + "tempChar": "" }, { "order": 1184, @@ -4400,7 +4454,7 @@ "name": "folder", "prevSize": 32, "code": 59667, - "tempChar": "" + "tempChar": "" }, { "order": 1185, @@ -4408,7 +4462,7 @@ "name": "bots", "prevSize": 32, "code": 59669, - "tempChar": "" + "tempChar": "" }, { "order": 1186, @@ -4416,7 +4470,7 @@ "name": "calendar", "prevSize": 32, "code": 59670, - "tempChar": "" + "tempChar": "" }, { "order": 1187, @@ -4424,7 +4478,7 @@ "name": "cloud-download", "prevSize": 32, "code": 59671, - "tempChar": "" + "tempChar": "" }, { "order": 1188, @@ -4432,7 +4486,7 @@ "name": "colorize", "prevSize": 32, "code": 59672, - "tempChar": "" + "tempChar": "" }, { "order": 1189, @@ -4440,7 +4494,7 @@ "name": "forward", "prevSize": 32, "code": 59687, - "tempChar": "" + "tempChar": "" }, { "order": 1190, @@ -4448,7 +4502,7 @@ "name": "reply", "prevSize": 32, "code": 59719, - "tempChar": "" + "tempChar": "" }, { "order": 1191, @@ -4456,7 +4510,7 @@ "name": "help", "prevSize": 32, "code": 59690, - "tempChar": "" + "tempChar": "" }, { "order": 1192, @@ -4464,7 +4518,7 @@ "name": "info", "prevSize": 32, "code": 59691, - "tempChar": "" + "tempChar": "" }, { "order": 1193, @@ -4472,7 +4526,7 @@ "name": "info-filled", "prevSize": 32, "code": 59675, - "tempChar": "" + "tempChar": "" }, { "order": 1194, @@ -4480,7 +4534,7 @@ "name": "delete-filled", "prevSize": 32, "code": 59676, - "tempChar": "" + "tempChar": "" }, { "order": 1195, @@ -4488,7 +4542,7 @@ "name": "delete", "prevSize": 32, "code": 59677, - "tempChar": "" + "tempChar": "" }, { "order": 1196, @@ -4496,7 +4550,7 @@ "name": "edit", "prevSize": 32, "code": 59683, - "tempChar": "" + "tempChar": "" }, { "order": 1197, @@ -4504,7 +4558,7 @@ "name": "new-chat-filled", "prevSize": 32, "code": 59705, - "tempChar": "" + "tempChar": "" }, { "order": 1198, @@ -4512,7 +4566,7 @@ "name": "send", "prevSize": 32, "code": 59722, - "tempChar": "" + "tempChar": "" }, { "order": 1199, @@ -4520,7 +4574,7 @@ "name": "send-outline", "prevSize": 32, "code": 59723, - "tempChar": "" + "tempChar": "" }, { "order": 1200, @@ -4528,7 +4582,7 @@ "name": "poll", "prevSize": 32, "code": 59704, - "tempChar": "" + "tempChar": "" }, { "order": 1201, @@ -4536,7 +4590,7 @@ "name": "revote", "prevSize": 32, "code": 59706, - "tempChar": "" + "tempChar": "" }, { "order": 1202, @@ -4544,7 +4598,7 @@ "name": "photo", "prevSize": 32, "code": 59712, - "tempChar": "" + "tempChar": "" }, { "order": 1203, @@ -4552,7 +4606,7 @@ "name": "document", "prevSize": 32, "code": 59679, - "tempChar": "" + "tempChar": "" }, { "order": 1204, @@ -4560,7 +4614,7 @@ "name": "logout", "prevSize": 32, "code": 59698, - "tempChar": "" + "tempChar": "" }, { "order": 1205, @@ -4568,7 +4622,7 @@ "name": "saved-messages", "prevSize": 32, "code": 59720, - "tempChar": "" + "tempChar": "" }, { "order": 1206, @@ -4576,7 +4630,7 @@ "name": "settings", "prevSize": 32, "code": 59726, - "tempChar": "" + "tempChar": "" }, { "order": 1207, @@ -4584,7 +4638,7 @@ "name": "phone", "prevSize": 32, "code": 59711, - "tempChar": "" + "tempChar": "" }, { "order": 1208, @@ -4592,7 +4646,7 @@ "name": "attach", "prevSize": 32, "code": 59657, - "tempChar": "" + "tempChar": "" }, { "order": 1209, @@ -4600,7 +4654,7 @@ "name": "copy", "prevSize": 32, "code": 59674, - "tempChar": "" + "tempChar": "" }, { "order": 1210, @@ -4608,7 +4662,7 @@ "name": "channel-filled", "prevSize": 32, "code": 59851, - "tempChar": "" + "tempChar": "" }, { "order": 1211, @@ -4616,7 +4670,7 @@ "name": "channel", "prevSize": 32, "code": 59665, - "tempChar": "" + "tempChar": "" }, { "order": 1212, @@ -4624,7 +4678,7 @@ "name": "group-filled", "prevSize": 32, "code": 59852, - "tempChar": "" + "tempChar": "" }, { "order": 1213, @@ -4632,7 +4686,7 @@ "name": "group", "prevSize": 32, "code": 59689, - "tempChar": "" + "tempChar": "" }, { "order": 1214, @@ -4640,7 +4694,7 @@ "name": "add-user-filled", "prevSize": 32, "code": 59652, - "tempChar": "" + "tempChar": "" }, { "order": 1215, @@ -4648,7 +4702,7 @@ "name": "add-user", "prevSize": 32, "code": 59653, - "tempChar": "" + "tempChar": "" }, { "order": 1216, @@ -4656,7 +4710,7 @@ "name": "delete-user", "prevSize": 32, "code": 59678, - "tempChar": "" + "tempChar": "" }, { "order": 1217, @@ -4664,7 +4718,7 @@ "name": "non-contacts", "prevSize": 32, "code": 59688, - "tempChar": "" + "tempChar": "" }, { "order": 1218, @@ -4672,7 +4726,7 @@ "name": "user", "prevSize": 32, "code": 59737, - "tempChar": "" + "tempChar": "" }, { "order": 1219, @@ -4680,7 +4734,7 @@ "name": "user-filled", "prevSize": 32, "code": 59853, - "tempChar": "" + "tempChar": "" }, { "order": 1220, @@ -4688,7 +4742,7 @@ "name": "active-sessions", "prevSize": 32, "code": 59650, - "tempChar": "" + "tempChar": "" }, { "order": 1221, @@ -4696,7 +4750,7 @@ "name": "admin", "prevSize": 32, "code": 59654, - "tempChar": "" + "tempChar": "" }, { "order": 1222, @@ -4704,7 +4758,7 @@ "name": "previous", "prevSize": 32, "code": 59759, - "tempChar": "" + "tempChar": "" }, { "order": 1223, @@ -4712,7 +4766,7 @@ "name": "next", "prevSize": 32, "code": 59756, - "tempChar": "" + "tempChar": "" }, { "order": 1224, @@ -4720,7 +4774,7 @@ "name": "expand", "prevSize": 32, "code": 59838, - "tempChar": "" + "tempChar": "" }, { "order": 1225, @@ -4728,7 +4782,7 @@ "name": "collapse", "prevSize": 32, "code": 59837, - "tempChar": "" + "tempChar": "" }, { "order": 1226, @@ -4736,7 +4790,7 @@ "name": "download", "prevSize": 32, "code": 59681, - "tempChar": "" + "tempChar": "" }, { "order": 1227, @@ -4744,7 +4798,7 @@ "name": "pinned-message", "prevSize": 32, "code": 59839, - "tempChar": "" + "tempChar": "" }, { "order": 1228, @@ -4752,7 +4806,7 @@ "name": "pin-badge", "prevSize": 32, "code": 59814, - "tempChar": "" + "tempChar": "" }, { "order": 1229, @@ -4760,7 +4814,7 @@ "name": "location", "prevSize": 32, "code": 59696, - "tempChar": "" + "tempChar": "" }, { "order": 1230, @@ -4768,7 +4822,7 @@ "name": "stop", "prevSize": 32, "code": 59730, - "tempChar": "" + "tempChar": "" }, { "order": 1231, @@ -4776,7 +4830,7 @@ "name": "archive-to-main", "prevSize": 32, "code": 59836, - "tempChar": "" + "tempChar": "" }, { "order": 1232, @@ -4784,7 +4838,7 @@ "name": "archive-from-main", "prevSize": 32, "code": 59835, - "tempChar": "" + "tempChar": "" }, { "order": 1233, @@ -4792,7 +4846,7 @@ "name": "archive-filled", "prevSize": 32, "code": 59834, - "tempChar": "" + "tempChar": "" }, { "order": 1234, @@ -4800,7 +4854,7 @@ "name": "archive", "prevSize": 32, "code": 59656, - "tempChar": "" + "tempChar": "" }, { "order": 1235, @@ -4808,7 +4862,7 @@ "name": "unarchive", "prevSize": 32, "code": 59731, - "tempChar": "" + "tempChar": "" }, { "order": 1236, @@ -4816,7 +4870,7 @@ "name": "chats-badge", "prevSize": 32, "code": 59809, - "tempChar": "" + "tempChar": "" }, { "order": 1237, @@ -4824,7 +4878,7 @@ "name": "chat-badge", "prevSize": 32, "code": 59808, - "tempChar": "" + "tempChar": "" }, { "order": 1238, @@ -4832,7 +4886,7 @@ "name": "share-screen", "prevSize": 32, "code": 59770, - "tempChar": "" + "tempChar": "" }, { "order": 1239, @@ -4840,7 +4894,7 @@ "name": "share-screen-outlined", "prevSize": 32, "code": 59782, - "tempChar": "" + "tempChar": "" }, { "order": 1240, @@ -4848,7 +4902,7 @@ "name": "replies", "prevSize": 32, "code": 59833, - "tempChar": "" + "tempChar": "" }, { "order": 1241, @@ -4856,7 +4910,7 @@ "name": "readchats", "prevSize": 32, "code": 59699, - "tempChar": "" + "tempChar": "" }, { "order": 1242, @@ -4864,7 +4918,7 @@ "name": "unread", "prevSize": 32, "code": 59735, - "tempChar": "" + "tempChar": "" }, { "order": 1243, @@ -4872,7 +4926,7 @@ "name": "message", "prevSize": 32, "code": 59700, - "tempChar": "" + "tempChar": "" }, { "order": 1244, @@ -4880,7 +4934,7 @@ "name": "comments", "prevSize": 32, "code": 59748, - "tempChar": "" + "tempChar": "" }, { "order": 1245, @@ -4888,7 +4942,7 @@ "name": "comments-sticker", "prevSize": 32, "code": 59749, - "tempChar": "" + "tempChar": "" }, { "order": 1246, @@ -4896,7 +4950,7 @@ "name": "key", "prevSize": 32, "code": 59802, - "tempChar": "" + "tempChar": "" }, { "order": 1247, @@ -4904,7 +4958,7 @@ "name": "unlock-badge", "prevSize": 32, "code": 59816, - "tempChar": "" + "tempChar": "" }, { "order": 1248, @@ -4912,7 +4966,7 @@ "name": "lock-badge", "prevSize": 32, "code": 59817, - "tempChar": "" + "tempChar": "" }, { "order": 1249, @@ -4920,7 +4974,7 @@ "name": "lock", "prevSize": 32, "code": 59697, - "tempChar": "" + "tempChar": "" }, { "order": 1250, @@ -4928,7 +4982,7 @@ "name": "unlock", "prevSize": 32, "code": 59732, - "tempChar": "" + "tempChar": "" }, { "order": 1251, @@ -4936,7 +4990,7 @@ "name": "mute", "prevSize": 32, "code": 59703, - "tempChar": "" + "tempChar": "" }, { "order": 1252, @@ -4944,7 +4998,7 @@ "name": "unmute", "prevSize": 32, "code": 59733, - "tempChar": "" + "tempChar": "" }, { "order": 1253, @@ -4952,7 +5006,7 @@ "name": "pin", "prevSize": 32, "code": 59713, - "tempChar": "" + "tempChar": "" }, { "order": 1254, @@ -4960,7 +5014,7 @@ "name": "unpin", "prevSize": 32, "code": 59734, - "tempChar": "" + "tempChar": "" }, { "order": 1255, @@ -4968,7 +5022,7 @@ "name": "smallscreen", "prevSize": 32, "code": 59742, - "tempChar": "" + "tempChar": "" }, { "order": 1256, @@ -4976,7 +5030,7 @@ "name": "fullscreen", "prevSize": 32, "code": 59743, - "tempChar": "" + "tempChar": "" }, { "order": 1257, @@ -4984,7 +5038,7 @@ "name": "large-pause", "prevSize": 32, "code": 59694, - "tempChar": "" + "tempChar": "" }, { "order": 1258, @@ -4992,7 +5046,7 @@ "name": "large-play", "prevSize": 32, "code": 59695, - "tempChar": "" + "tempChar": "" }, { "order": 1259, @@ -5000,7 +5054,7 @@ "name": "pause", "prevSize": 32, "code": 59709, - "tempChar": "" + "tempChar": "" }, { "order": 1260, @@ -5008,7 +5062,7 @@ "name": "play", "prevSize": 32, "code": 59715, - "tempChar": "" + "tempChar": "" }, { "order": 1261, @@ -5016,7 +5070,7 @@ "name": "channelviews", "prevSize": 32, "code": 59666, - "tempChar": "" + "tempChar": "" }, { "order": 1262, @@ -5024,7 +5078,7 @@ "name": "message-succeeded", "prevSize": 32, "code": 59648, - "tempChar": "" + "tempChar": "" }, { "order": 1263, @@ -5032,7 +5086,7 @@ "name": "message-read", "prevSize": 32, "code": 59649, - "tempChar": "" + "tempChar": "" }, { "order": 1264, @@ -5040,7 +5094,7 @@ "name": "message-pending", "prevSize": 32, "code": 59724, - "tempChar": "" + "tempChar": "" }, { "order": 1265, @@ -5048,7 +5102,7 @@ "name": "message-failed", "prevSize": 32, "code": 59725, - "tempChar": "" + "tempChar": "" }, { "order": 1266, @@ -5056,7 +5110,7 @@ "name": "favorite", "prevSize": 32, "code": 59710, - "tempChar": "" + "tempChar": "" }, { "order": 1267, @@ -5064,7 +5118,7 @@ "name": "keyboard", "prevSize": 32, "code": 59716, - "tempChar": "" + "tempChar": "" }, { "order": 1268, @@ -5072,7 +5126,7 @@ "name": "delete-left", "prevSize": 32, "code": 59717, - "tempChar": "" + "tempChar": "" }, { "order": 1269, @@ -5080,7 +5134,7 @@ "name": "recent", "prevSize": 32, "code": 59718, - "tempChar": "" + "tempChar": "" }, { "order": 1270, @@ -5088,7 +5142,7 @@ "name": "gifs", "prevSize": 32, "code": 59727, - "tempChar": "" + "tempChar": "" }, { "order": 1271, @@ -5096,7 +5150,7 @@ "name": "stickers", "prevSize": 32, "code": 59739, - "tempChar": "" + "tempChar": "" }, { "order": 1272, @@ -5104,7 +5158,7 @@ "name": "smile", "prevSize": 32, "code": 59728, - "tempChar": "" + "tempChar": "" }, { "order": 1273, @@ -5112,7 +5166,7 @@ "name": "animals", "prevSize": 32, "code": 59655, - "tempChar": "" + "tempChar": "" }, { "order": 1274, @@ -5120,7 +5174,7 @@ "name": "eats", "prevSize": 32, "code": 59682, - "tempChar": "" + "tempChar": "" }, { "order": 1275, @@ -5128,7 +5182,7 @@ "name": "sport", "prevSize": 32, "code": 59729, - "tempChar": "" + "tempChar": "" }, { "order": 1276, @@ -5136,7 +5190,7 @@ "name": "car", "prevSize": 32, "code": 59664, - "tempChar": "" + "tempChar": "" }, { "order": 1277, @@ -5144,7 +5198,7 @@ "name": "lamp", "prevSize": 32, "code": 59692, - "tempChar": "" + "tempChar": "" }, { "order": 1278, @@ -5152,7 +5206,7 @@ "name": "language", "prevSize": 32, "code": 59693, - "tempChar": "" + "tempChar": "" }, { "order": 1279, @@ -5160,7 +5214,7 @@ "name": "flag", "prevSize": 32, "code": 59686, - "tempChar": "" + "tempChar": "" }, { "order": 1280, @@ -5168,7 +5222,7 @@ "name": "more", "prevSize": 32, "code": 59702, - "tempChar": "" + "tempChar": "" }, { "order": 1281, @@ -5176,7 +5230,7 @@ "name": "search", "prevSize": 32, "code": 59721, - "tempChar": "" + "tempChar": "" }, { "order": 1282, @@ -5184,7 +5238,7 @@ "name": "remove", "prevSize": 32, "code": 59740, - "tempChar": "" + "tempChar": "" }, { "order": 1283, @@ -5192,7 +5246,7 @@ "name": "add", "prevSize": 32, "code": 59651, - "tempChar": "" + "tempChar": "" }, { "order": 1284, @@ -5200,7 +5254,7 @@ "name": "check", "prevSize": 32, "code": 59668, - "tempChar": "" + "tempChar": "" }, { "order": 1285, @@ -5208,7 +5262,7 @@ "name": "close", "prevSize": 32, "code": 59673, - "tempChar": "" + "tempChar": "" }, { "order": 1286, @@ -5216,7 +5270,7 @@ "name": "arrow-left", "prevSize": 32, "code": 59661, - "tempChar": "" + "tempChar": "" }, { "order": 1287, @@ -5224,7 +5278,7 @@ "name": "arrow-right", "prevSize": 32, "code": 59708, - "tempChar": "" + "tempChar": "" }, { "order": 1288, @@ -5232,7 +5286,7 @@ "name": "down", "prevSize": 32, "code": 59680, - "tempChar": "" + "tempChar": "" }, { "order": 1289, @@ -5240,7 +5294,7 @@ "name": "up", "prevSize": 32, "code": 59736, - "tempChar": "" + "tempChar": "" }, { "order": 1290, @@ -5248,7 +5302,7 @@ "name": "eye-closed", "prevSize": 32, "code": 59685, - "tempChar": "" + "tempChar": "" }, { "order": 1291, @@ -5256,7 +5310,7 @@ "name": "eye", "prevSize": 32, "code": 59684, - "tempChar": "" + "tempChar": "" }, { "order": 1292, @@ -5264,7 +5318,7 @@ "name": "muted", "prevSize": 32, "code": 59741, - "tempChar": "" + "tempChar": "" }, { "order": 1293, @@ -5272,7 +5326,7 @@ "name": "avatar-archived-chats", "prevSize": 32, "code": 59658, - "tempChar": "" + "tempChar": "" }, { "order": 1294, @@ -5280,7 +5334,7 @@ "name": "avatar-deleted-account", "prevSize": 32, "code": 59659, - "tempChar": "" + "tempChar": "" }, { "order": 1295, @@ -5288,7 +5342,7 @@ "name": "avatar-saved-messages", "prevSize": 32, "code": 59660, - "tempChar": "" + "tempChar": "" }, { "order": 1296, @@ -5296,7 +5350,7 @@ "name": "pinned-chat", "prevSize": 32, "code": 59714, - "tempChar": "" + "tempChar": "" } ], "prevSize": 32, @@ -5347,5 +5401,6 @@ "showGrid": true, "showLiga": false }, - "uid": -1 + "uid": -1, + "time": 1694400511614 } \ No newline at end of file diff --git a/src/styles/icons.scss b/src/styles/icons.scss index b9eb5a702..0386ae6eb 100644 --- a/src/styles/icons.scss +++ b/src/styles/icons.scss @@ -3,8 +3,8 @@ $icons-font: "icons"; @font-face { font-family: $icons-font; - src: url("./icons.woff2?2fc8ce731efb721947ab7acfba88eb91") format("woff2"), -url("./icons.woff?2fc8ce731efb721947ab7acfba88eb91") format("woff"); + src: url("./icons.woff2?2e8e2fec4b27141c4d298083615a0665") format("woff2"), +url("./icons.woff?2e8e2fec4b27141c4d298083615a0665") format("woff"); font-weight: normal; font-style: normal; font-display: block; @@ -52,204 +52,206 @@ $icons-map: ( "arrow-down": "\f10f", "arrow-left": "\f110", "arrow-right": "\f111", - "attach": "\f112", - "avatar-archived-chats": "\f113", - "avatar-deleted-account": "\f114", - "avatar-saved-messages": "\f115", - "bold": "\f116", - "bot-command": "\f117", - "bot-commands-filled": "\f118", - "bots": "\f119", - "bug": "\f11a", - "calendar-filter": "\f11b", - "calendar": "\f11c", - "camera-add": "\f11d", - "camera": "\f11e", - "car": "\f11f", - "card": "\f120", - "channel-filled": "\f121", - "channel": "\f122", - "channelviews": "\f123", - "chat-badge": "\f124", - "chats-badge": "\f125", - "check": "\f126", - "close-circle": "\f127", - "close-topic": "\f128", - "close": "\f129", - "cloud-download": "\f12a", - "collapse": "\f12b", - "colorize": "\f12c", - "comments-sticker": "\f12d", - "comments": "\f12e", - "copy-media": "\f12f", - "copy": "\f130", - "darkmode": "\f131", - "data": "\f132", - "delete-filled": "\f133", - "delete-left": "\f134", - "delete-user": "\f135", - "delete": "\f136", - "document": "\f137", - "double-badge": "\f138", - "down": "\f139", - "download": "\f13a", - "eats": "\f13b", - "edit": "\f13c", - "email": "\f13d", - "enter": "\f13e", - "expand": "\f13f", - "eye-closed-outline": "\f140", - "eye-closed": "\f141", - "eye-outline": "\f142", - "eye": "\f143", - "favorite-filled": "\f144", - "favorite": "\f145", - "file-badge": "\f146", - "flag": "\f147", - "folder-badge": "\f148", - "folder": "\f149", - "fontsize": "\f14a", - "forums": "\f14b", - "forward": "\f14c", - "fullscreen": "\f14d", - "gifs": "\f14e", - "gift": "\f14f", - "group-filled": "\f150", - "group": "\f151", - "grouped-disable": "\f152", - "grouped": "\f153", - "hand-stop": "\f154", - "hashtag": "\f155", - "heart-outline": "\f156", - "heart": "\f157", - "help": "\f158", - "info-filled": "\f159", - "info": "\f15a", - "install": "\f15b", - "italic": "\f15c", - "key": "\f15d", - "keyboard": "\f15e", - "lamp": "\f15f", - "language": "\f160", - "large-pause": "\f161", - "large-play": "\f162", - "link-badge": "\f163", - "link-broken": "\f164", - "link": "\f165", - "location": "\f166", - "lock-badge": "\f167", - "lock": "\f168", - "logout": "\f169", - "loop": "\f16a", - "mention": "\f16b", - "message-failed": "\f16c", - "message-pending": "\f16d", - "message-read": "\f16e", - "message-succeeded": "\f16f", - "message": "\f170", - "microphone-alt": "\f171", - "microphone": "\f172", - "monospace": "\f173", - "more-circle": "\f174", - "more": "\f175", - "mute": "\f176", - "muted": "\f177", - "new-chat-filled": "\f178", - "next": "\f179", - "noise-suppression": "\f17a", - "non-contacts": "\f17b", - "open-in-new-tab": "\f17c", - "password-off": "\f17d", - "pause": "\f17e", - "permissions": "\f17f", - "phone-discard-outline": "\f180", - "phone-discard": "\f181", - "phone": "\f182", - "photo": "\f183", - "pin-badge": "\f184", - "pin-list": "\f185", - "pin": "\f186", - "pinned-chat": "\f187", - "pinned-message": "\f188", - "pip": "\f189", - "play-story": "\f18a", - "play": "\f18b", - "poll": "\f18c", - "premium": "\f18d", - "previous": "\f18e", - "readchats": "\f18f", - "recent": "\f190", - "reload": "\f191", - "remove": "\f192", - "reopen-topic": "\f193", - "replace": "\f194", - "replies": "\f195", - "reply-filled": "\f196", - "reply": "\f197", - "revote": "\f198", - "save-story": "\f199", - "saved-messages": "\f19a", - "schedule": "\f19b", - "search": "\f19c", - "select": "\f19d", - "send-outline": "\f19e", - "send": "\f19f", - "settings-filled": "\f1a0", - "settings": "\f1a1", - "share-filled": "\f1a2", - "share-screen-outlined": "\f1a3", - "share-screen-stop": "\f1a4", - "share-screen": "\f1a5", - "sidebar": "\f1a6", - "skip-next": "\f1a7", - "skip-previous": "\f1a8", - "smallscreen": "\f1a9", - "smile": "\f1aa", - "sort": "\f1ab", - "speaker-muted-story": "\f1ac", - "speaker-outline": "\f1ad", - "speaker-story": "\f1ae", - "speaker": "\f1af", - "spoiler-disable": "\f1b0", - "spoiler": "\f1b1", - "sport": "\f1b2", - "stats": "\f1b3", - "stealth-future": "\f1b4", - "stealth-past": "\f1b5", - "stickers": "\f1b6", - "stop-raising-hand": "\f1b7", - "stop": "\f1b8", - "story-caption": "\f1b9", - "story-expired": "\f1ba", - "story-priority": "\f1bb", - "story-reply": "\f1bc", - "strikethrough": "\f1bd", - "timer": "\f1be", - "transcribe": "\f1bf", - "truck": "\f1c0", - "unarchive": "\f1c1", - "underlined": "\f1c2", - "unlock-badge": "\f1c3", - "unlock": "\f1c4", - "unmute": "\f1c5", - "unpin": "\f1c6", - "unread": "\f1c7", - "up": "\f1c8", - "user-filled": "\f1c9", - "user-online": "\f1ca", - "user": "\f1cb", - "video-outlined": "\f1cc", - "video-stop": "\f1cd", - "video": "\f1ce", - "voice-chat": "\f1cf", - "volume-1": "\f1d0", - "volume-2": "\f1d1", - "volume-3": "\f1d2", - "web": "\f1d3", - "webapp": "\f1d4", - "word-wrap": "\f1d5", - "zoom-in": "\f1d6", - "zoom-out": "\f1d7", + "ask-support": "\f112", + "attach": "\f113", + "avatar-archived-chats": "\f114", + "avatar-deleted-account": "\f115", + "avatar-saved-messages": "\f116", + "bold": "\f117", + "bot-command": "\f118", + "bot-commands-filled": "\f119", + "bots": "\f11a", + "bug": "\f11b", + "calendar-filter": "\f11c", + "calendar": "\f11d", + "camera-add": "\f11e", + "camera": "\f11f", + "car": "\f120", + "card": "\f121", + "channel-filled": "\f122", + "channel": "\f123", + "channelviews": "\f124", + "chat-badge": "\f125", + "chats-badge": "\f126", + "check": "\f127", + "close-circle": "\f128", + "close-topic": "\f129", + "close": "\f12a", + "cloud-download": "\f12b", + "collapse": "\f12c", + "colorize": "\f12d", + "comments-sticker": "\f12e", + "comments": "\f12f", + "copy-media": "\f130", + "copy": "\f131", + "darkmode": "\f132", + "data": "\f133", + "delete-filled": "\f134", + "delete-left": "\f135", + "delete-user": "\f136", + "delete": "\f137", + "document": "\f138", + "double-badge": "\f139", + "down": "\f13a", + "download": "\f13b", + "eats": "\f13c", + "edit": "\f13d", + "email": "\f13e", + "enter": "\f13f", + "expand": "\f140", + "eye-closed-outline": "\f141", + "eye-closed": "\f142", + "eye-outline": "\f143", + "eye": "\f144", + "favorite-filled": "\f145", + "favorite": "\f146", + "file-badge": "\f147", + "flag": "\f148", + "folder-badge": "\f149", + "folder": "\f14a", + "fontsize": "\f14b", + "forums": "\f14c", + "forward": "\f14d", + "fullscreen": "\f14e", + "gifs": "\f14f", + "gift": "\f150", + "group-filled": "\f151", + "group": "\f152", + "grouped-disable": "\f153", + "grouped": "\f154", + "hand-stop": "\f155", + "hashtag": "\f156", + "heart-outline": "\f157", + "heart": "\f158", + "help": "\f159", + "info-filled": "\f15a", + "info": "\f15b", + "install": "\f15c", + "italic": "\f15d", + "key": "\f15e", + "keyboard": "\f15f", + "lamp": "\f160", + "language": "\f161", + "large-pause": "\f162", + "large-play": "\f163", + "link-badge": "\f164", + "link-broken": "\f165", + "link": "\f166", + "location": "\f167", + "lock-badge": "\f168", + "lock": "\f169", + "logout": "\f16a", + "loop": "\f16b", + "mention": "\f16c", + "message-failed": "\f16d", + "message-pending": "\f16e", + "message-read": "\f16f", + "message-succeeded": "\f170", + "message": "\f171", + "microphone-alt": "\f172", + "microphone": "\f173", + "monospace": "\f174", + "more-circle": "\f175", + "more": "\f176", + "mute": "\f177", + "muted": "\f178", + "new-chat-filled": "\f179", + "next": "\f17a", + "noise-suppression": "\f17b", + "non-contacts": "\f17c", + "open-in-new-tab": "\f17d", + "password-off": "\f17e", + "pause": "\f17f", + "permissions": "\f180", + "phone-discard-outline": "\f181", + "phone-discard": "\f182", + "phone": "\f183", + "photo": "\f184", + "pin-badge": "\f185", + "pin-list": "\f186", + "pin": "\f187", + "pinned-chat": "\f188", + "pinned-message": "\f189", + "pip": "\f18a", + "play-story": "\f18b", + "play": "\f18c", + "poll": "\f18d", + "premium": "\f18e", + "previous": "\f18f", + "privacy-policy": "\f190", + "readchats": "\f191", + "recent": "\f192", + "reload": "\f193", + "remove": "\f194", + "reopen-topic": "\f195", + "replace": "\f196", + "replies": "\f197", + "reply-filled": "\f198", + "reply": "\f199", + "revote": "\f19a", + "save-story": "\f19b", + "saved-messages": "\f19c", + "schedule": "\f19d", + "search": "\f19e", + "select": "\f19f", + "send-outline": "\f1a0", + "send": "\f1a1", + "settings-filled": "\f1a2", + "settings": "\f1a3", + "share-filled": "\f1a4", + "share-screen-outlined": "\f1a5", + "share-screen-stop": "\f1a6", + "share-screen": "\f1a7", + "sidebar": "\f1a8", + "skip-next": "\f1a9", + "skip-previous": "\f1aa", + "smallscreen": "\f1ab", + "smile": "\f1ac", + "sort": "\f1ad", + "speaker-muted-story": "\f1ae", + "speaker-outline": "\f1af", + "speaker-story": "\f1b0", + "speaker": "\f1b1", + "spoiler-disable": "\f1b2", + "spoiler": "\f1b3", + "sport": "\f1b4", + "stats": "\f1b5", + "stealth-future": "\f1b6", + "stealth-past": "\f1b7", + "stickers": "\f1b8", + "stop-raising-hand": "\f1b9", + "stop": "\f1ba", + "story-caption": "\f1bb", + "story-expired": "\f1bc", + "story-priority": "\f1bd", + "story-reply": "\f1be", + "strikethrough": "\f1bf", + "timer": "\f1c0", + "transcribe": "\f1c1", + "truck": "\f1c2", + "unarchive": "\f1c3", + "underlined": "\f1c4", + "unlock-badge": "\f1c5", + "unlock": "\f1c6", + "unmute": "\f1c7", + "unpin": "\f1c8", + "unread": "\f1c9", + "up": "\f1ca", + "user-filled": "\f1cb", + "user-online": "\f1cc", + "user": "\f1cd", + "video-outlined": "\f1ce", + "video-stop": "\f1cf", + "video": "\f1d0", + "voice-chat": "\f1d1", + "volume-1": "\f1d2", + "volume-2": "\f1d3", + "volume-3": "\f1d4", + "web": "\f1d5", + "webapp": "\f1d6", + "word-wrap": "\f1d7", + "zoom-in": "\f1d8", + "zoom-out": "\f1d9", ); .icon-active-sessions::before { @@ -303,6 +305,9 @@ $icons-map: ( .icon-arrow-right::before { content: map.get($icons-map, "arrow-right"); } +.icon-ask-support::before { + content: map.get($icons-map, "ask-support"); +} .icon-attach::before { content: map.get($icons-map, "attach"); } @@ -678,6 +683,9 @@ $icons-map: ( .icon-previous::before { content: map.get($icons-map, "previous"); } +.icon-privacy-policy::before { + content: map.get($icons-map, "privacy-policy"); +} .icon-readchats::before { content: map.get($icons-map, "readchats"); } diff --git a/src/styles/icons.woff b/src/styles/icons.woff index c631e38e0..ee3396447 100644 Binary files a/src/styles/icons.woff and b/src/styles/icons.woff differ diff --git a/src/styles/icons.woff2 b/src/styles/icons.woff2 index 94da0a4e7..76cbad0bf 100644 Binary files a/src/styles/icons.woff2 and b/src/styles/icons.woff2 differ diff --git a/src/types/icons/font.ts b/src/types/icons/font.ts index 075621542..55b6f4ba1 100644 --- a/src/types/icons/font.ts +++ b/src/types/icons/font.ts @@ -16,6 +16,7 @@ export type FontIconName = | 'arrow-down' | 'arrow-left' | 'arrow-right' + | 'ask-support' | 'attach' | 'avatar-archived-chats' | 'avatar-deleted-account' @@ -141,6 +142,7 @@ export type FontIconName = | 'poll' | 'premium' | 'previous' + | 'privacy-policy' | 'readchats' | 'recent' | 'reload' diff --git a/src/types/index.ts b/src/types/index.ts index a58eb22e2..69eef939e 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -3,9 +3,10 @@ import type { TeactNode } from '../lib/teact/teact'; import type { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm, ApiBotInlineSwitchWebview, + ApiChat, ApiChatInviteImporter, ApiExportedInvite, - ApiLanguage, ApiMessage, ApiReaction, ApiStickerSet, + ApiLanguage, ApiMessage, ApiReaction, ApiStickerSet, ApiUser, } from '../api/types'; export type TextPart = TeactNode; @@ -112,23 +113,20 @@ export interface ISettings extends NotifySettings, Record { export interface ApiPrivacySettings { visibility: PrivacyVisibility; + isUnspecified?: boolean; allowUserIds: string[]; allowChatIds: string[]; blockUserIds: string[]; blockChatIds: string[]; } -export interface InputPrivacyContact { - id: string; - accessHash?: string; -} - -export interface InputPrivacyRules { +export interface ApiInputPrivacyRules { visibility: PrivacyVisibility; - allowedUsers?: InputPrivacyContact[]; - allowedChats?: InputPrivacyContact[]; - blockedUsers?: InputPrivacyContact[]; - blockedChats?: InputPrivacyContact[]; + isUnspecified?: boolean; + allowedUsers?: ApiUser[]; + allowedChats?: ApiChat[]; + blockedUsers?: ApiUser[]; + blockedChats?: ApiChat[]; } export type IAnchorPosition = { @@ -173,8 +171,10 @@ export enum SettingsScreens { GeneralChatBackgroundColor, Privacy, PrivacyPhoneNumber, + PrivacyAddByPhone, PrivacyLastSeen, PrivacyProfilePhoto, + PrivacyBio, PrivacyPhoneCall, PrivacyPhoneP2P, PrivacyForwarding, @@ -186,6 +186,8 @@ export enum SettingsScreens { PrivacyLastSeenDeniedContacts, PrivacyProfilePhotoAllowedContacts, PrivacyProfilePhotoDeniedContacts, + PrivacyBioAllowedContacts, + PrivacyBioDeniedContacts, PrivacyPhoneCallAllowedContacts, PrivacyPhoneCallDeniedContacts, PrivacyPhoneP2PAllowedContacts, @@ -354,10 +356,9 @@ export type ProfileTabType = ( 'members' | 'commonChats' | 'media' | 'documents' | 'links' | 'audio' | 'voice' | 'stories' | 'storiesArchive' ); export type SharedMediaType = 'media' | 'documents' | 'links' | 'audio' | 'voice'; -export type ApiPrivacyKey = 'phoneNumber' | 'lastSeen' | 'profilePhoto' | 'voiceMessages' | -'forwards' | 'chatInvite' | 'phoneCall' | 'phoneP2P'; -export type PrivacyVisibility = 'everybody' | 'contacts' | 'closeFriends' | 'selectedContacts' | 'nonContacts' | -'nobody'; +export type ApiPrivacyKey = 'phoneNumber' | 'addByPhone' | 'lastSeen' | 'profilePhoto' | 'voiceMessages' | +'forwards' | 'chatInvite' | 'phoneCall' | 'phoneP2P' | 'bio'; +export type PrivacyVisibility = 'everybody' | 'contacts' | 'closeFriends' | 'nonContacts' | 'nobody'; export enum ProfileState { Profile,