diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index c531f60a..0425fc74 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -41,7 +41,7 @@ import LazyLoadQueue from "../lazyLoadQueue"; import ListenerSetter from "../../helpers/listenerSetter"; import PollElement from "../poll"; import AudioElement from "../audio"; -import { ChatInvite, Message, MessageEntity, MessageMedia, MessageReplyHeader, Photo, PhotoSize, ReactionCount, ReplyMarkup, SponsoredMessage, Update, WebPage } from "../../layer"; +import { ChatInvite, Message, MessageEntity, MessageMedia, MessageReplyHeader, Photo, PhotoSize, ReactionCount, ReplyMarkup, SponsoredMessage, Update, User, WebPage } from "../../layer"; import { NULL_PEER_ID, REPLIES_PEER_ID } from "../../lib/mtproto/mtproto_config"; import { FocusDirection, ScrollStartCallbackDimensions } from "../../helpers/fastSmoothScroll"; import useHeavyAnimationCheck, { getHeavyAnimationPromise, dispatchHeavyAnimationEvent, interruptHeavyAnimation } from "../../hooks/useHeavyAnimationCheck"; @@ -97,6 +97,7 @@ import formatNumber from "../../helpers/number/formatNumber"; import findAndSplice from "../../helpers/array/findAndSplice"; import getViewportSlice from "../../helpers/dom/getViewportSlice"; import SuperIntersectionObserver from "../../helpers/dom/superIntersectionObserver"; +import generateFakeIcon from "../generateFakeIcon"; const USE_MEDIA_TAILS = false; const IGNORE_ACTIONS: Set = new Set([ @@ -3806,6 +3807,12 @@ export default class ChatBubbles { nameDiv = document.createElement('div'); nameDiv.append(title); + const peer = this.appPeersManager.getPeer(message.fromId); + const pFlags = (peer as User.user)?.pFlags; + if(pFlags && (pFlags.scam || pFlags.fake)) { + nameDiv.append(generateFakeIcon(pFlags.scam)); + } + if(!our) { nameDiv.style.color = this.appPeersManager.getPeerColorById(message.fromId, false); } diff --git a/src/scss/partials/_chatBubble.scss b/src/scss/partials/_chatBubble.scss index 6e369813..a10327f1 100644 --- a/src/scss/partials/_chatBubble.scss +++ b/src/scss/partials/_chatBubble.scss @@ -1877,6 +1877,12 @@ $bubble-beside-button-width: 38px; // order: 1; //width: max-content; //white-space: nowrap; + + .badge-fake { + display: inline-block; + vertical-align: middle; + margin-top: -2px; + } } /* &:not(.is-group-first) .bubble-content > .name .name {