diff --git a/src/api/gramjs/apiBuilders/users.ts b/src/api/gramjs/apiBuilders/users.ts index 3314f46b4..c2a6514c8 100644 --- a/src/api/gramjs/apiBuilders/users.ts +++ b/src/api/gramjs/apiBuilders/users.ts @@ -37,7 +37,7 @@ export function buildApiUserFullInfo(mtpUserFull: GramJs.users.UserFull): ApiUse birthday, personalChannelId, personalChannelMessage, sponsoredEnabled, stargiftsCount, botVerification, botCanManageEmojiStatus, settings, sendPaidMessagesStars, displayGiftsButton, disallowedGifts, starsRating, starsMyPendingRating, starsMyPendingRatingDate, mainTab, note, - noforwardsMyEnabled, noforwardsPeerEnabled, + noforwardsMyEnabled, noforwardsPeerEnabled, unofficialSecurityRisk, }, users, } = mtpUserFull; @@ -80,6 +80,7 @@ export function buildApiUserFullInfo(mtpUserFull: GramJs.users.UserFull): ApiUse note: note && buildApiFormattedText(note), noForwardsMyEnabled: noforwardsMyEnabled, noForwardsPeerEnabled: noforwardsPeerEnabled, + isUnofficialSecurityRisk: unofficialSecurityRisk, }; } diff --git a/src/api/types/users.ts b/src/api/types/users.ts index 2d834f307..0f3a9fbe8 100644 --- a/src/api/types/users.ts +++ b/src/api/types/users.ts @@ -87,6 +87,7 @@ export interface ApiUserFullInfo { note?: ApiFormattedText; noForwardsMyEnabled?: boolean; noForwardsPeerEnabled?: boolean; + isUnofficialSecurityRisk?: boolean; } export type ApiUserType = 'userTypeBot' | 'userTypeRegular' | 'userTypeDeleted' | 'userTypeUnknown'; diff --git a/src/assets/localization/fallback.strings b/src/assets/localization/fallback.strings index 0ccd11466..85eea8264 100644 --- a/src/assets/localization/fallback.strings +++ b/src/assets/localization/fallback.strings @@ -2814,3 +2814,4 @@ "ReminderSetToast" = "You set up a reminder in **Saved Messages**"; "NoForwardsRequestReject" = "Reject"; "NoForwardsRequestAccept" = "Accept"; +"UnofficialSecurityRisk" = "{peer} uses an unofficial Telegram client — messages to this user may be less secure." diff --git a/src/components/common/profile/ChatExtra.module.scss b/src/components/common/profile/ChatExtra.module.scss index 01e7ef501..f5ead89df 100644 --- a/src/components/common/profile/ChatExtra.module.scss +++ b/src/components/common/profile/ChatExtra.module.scss @@ -144,6 +144,18 @@ cursor: var(--custom-cursor, pointer); } +.unofficialSecurityRisk { + margin-bottom: 0.5rem; + padding-inline: 0.5rem; + line-height: 1.25; + text-wrap: balance; +} + +.riskIcon { + margin-inline-end: 0.25rem; + color: var(--color-error); +} + @include mixins.on-active-vt('profileNote') { &::view-transition-image-pair(.noteText) { overflow: hidden; diff --git a/src/components/common/profile/ChatExtra.tsx b/src/components/common/profile/ChatExtra.tsx index af5d69afe..481cd71f7 100644 --- a/src/components/common/profile/ChatExtra.tsx +++ b/src/components/common/profile/ChatExtra.tsx @@ -26,6 +26,7 @@ import { isUserRightBanned, } from '../../../global/helpers'; import { getIsChatMuted } from '../../../global/helpers/notifications'; +import { getPeerTitle } from '../../../global/helpers/peers'; import { selectBotAppPermissions, selectChat, @@ -392,6 +393,12 @@ const ChatExtra = ({ return (
+ {user && userFullInfo?.isUnofficialSecurityRisk && ( +
+ + {lang('UnofficialSecurityRisk', { peer: getPeerTitle(lang, user) })} +
+ )} {personalChannel && (

{oldLang('ProfileChannel')}

diff --git a/src/types/language.d.ts b/src/types/language.d.ts index d70f98a56..24568a2a9 100644 --- a/src/types/language.d.ts +++ b/src/types/language.d.ts @@ -3625,6 +3625,9 @@ export interface LangPairWithVariables { 'RankEditText': { 'user': V; }; + 'UnofficialSecurityRisk': { + 'peer': V; + }; } export interface LangPairPlural {