Browse Source

Add badge fake to message author's name

master
Eduard Kuzmenko 3 years ago
parent
commit
bcbea6706b
  1. 9
      src/components/chat/bubbles.ts
  2. 6
      src/scss/partials/_chatBubble.scss

9
src/components/chat/bubbles.ts

@ -41,7 +41,7 @@ import LazyLoadQueue from "../lazyLoadQueue"; @@ -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"; @@ -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<Message.messageService['action']['_']> = new Set([
@ -3806,6 +3807,12 @@ export default class ChatBubbles { @@ -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);
}

6
src/scss/partials/_chatBubble.scss

@ -1877,6 +1877,12 @@ $bubble-beside-button-width: 38px; @@ -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 {

Loading…
Cancel
Save