Profile: Show insecure client warning (#6845)

This commit is contained in:
zubiden 2026-04-14 14:36:42 +02:00 committed by Alexander Zinchuk
parent 32a0a1e9cd
commit 7b26965b45
6 changed files with 26 additions and 1 deletions

View File

@ -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,
};
}

View File

@ -87,6 +87,7 @@ export interface ApiUserFullInfo {
note?: ApiFormattedText;
noForwardsMyEnabled?: boolean;
noForwardsPeerEnabled?: boolean;
isUnofficialSecurityRisk?: boolean;
}
export type ApiUserType = 'userTypeBot' | 'userTypeRegular' | 'userTypeDeleted' | 'userTypeUnknown';

View File

@ -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."

View File

@ -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;

View File

@ -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 (
<div className={buildClassName('ChatExtra', className)} style={createVtnStyle('chatExtra')}>
{user && userFullInfo?.isUnofficialSecurityRisk && (
<div className={styles.unofficialSecurityRisk}>
<Icon className={buildClassName(styles.riskIcon, 'in-text-icon')} name="info-filled" />
{lang('UnofficialSecurityRisk', { peer: getPeerTitle(lang, user) })}
</div>
)}
{personalChannel && (
<div className={styles.personalChannel} style={createVtnStyle('personalChannel')}>
<h3 className={styles.personalChannelTitle}>{oldLang('ProfileChannel')}</h3>

View File

@ -3625,6 +3625,9 @@ export interface LangPairWithVariables<V = LangVariable> {
'RankEditText': {
'user': V;
};
'UnofficialSecurityRisk': {
'peer': V;
};
}
export interface LangPairPlural {