Profile: Show insecure client warning (#6845)
This commit is contained in:
parent
32a0a1e9cd
commit
7b26965b45
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -87,6 +87,7 @@ export interface ApiUserFullInfo {
|
||||
note?: ApiFormattedText;
|
||||
noForwardsMyEnabled?: boolean;
|
||||
noForwardsPeerEnabled?: boolean;
|
||||
isUnofficialSecurityRisk?: boolean;
|
||||
}
|
||||
|
||||
export type ApiUserType = 'userTypeBot' | 'userTypeRegular' | 'userTypeDeleted' | 'userTypeUnknown';
|
||||
|
||||
@ -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."
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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>
|
||||
|
||||
3
src/types/language.d.ts
vendored
3
src/types/language.d.ts
vendored
@ -3625,6 +3625,9 @@ export interface LangPairWithVariables<V = LangVariable> {
|
||||
'RankEditText': {
|
||||
'user': V;
|
||||
};
|
||||
'UnofficialSecurityRisk': {
|
||||
'peer': V;
|
||||
};
|
||||
}
|
||||
|
||||
export interface LangPairPlural {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user