From 7b26965b4577e4b661ac90de364e6edc2a46412b Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Tue, 14 Apr 2026 14:36:42 +0200 Subject: [PATCH] Profile: Show insecure client warning (#6845) --- src/api/gramjs/apiBuilders/users.ts | 3 ++- src/api/types/users.ts | 1 + src/assets/localization/fallback.strings | 1 + src/components/common/profile/ChatExtra.module.scss | 12 ++++++++++++ src/components/common/profile/ChatExtra.tsx | 7 +++++++ src/types/language.d.ts | 3 +++ 6 files changed, 26 insertions(+), 1 deletion(-) 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 (