diff --git a/src/components/chat/messageRender.ts b/src/components/chat/messageRender.ts index c87ca649..3e0def0a 100644 --- a/src/components/chat/messageRender.ts +++ b/src/components/chat/messageRender.ts @@ -29,7 +29,7 @@ export namespace MessageRender { bubble.classList.add('channel-post'); time = formatNumber(message.views, 1) + ' ' + (postAuthor ? RichTextProcessor.wrapEmojiText(postAuthor) + ', ' : '') + time; - if(!message.fwd_from?.saved_from_msg_id) { + if(!message.fwd_from?.saved_from_msg_id && chat.type !== 'pinned') { const forward = document.createElement('div'); forward.classList.add('bubble-beside-button', 'forward'); forward.innerHTML = ` diff --git a/src/components/popups/unpinMessage.ts b/src/components/popups/unpinMessage.ts index 382e0659..1e7496e8 100644 --- a/src/components/popups/unpinMessage.ts +++ b/src/components/popups/unpinMessage.ts @@ -9,13 +9,14 @@ import { addCancelButton } from "."; import PopupPeer, { PopupPeerButtonCallbackCheckboxes, PopupPeerOptions } from "./peer"; import appPeersManager from "../../lib/appManagers/appPeersManager"; import rootScope from "../../lib/rootScope"; -import { LangPackKey } from "../../lib/langPack"; +import { FormatterArguments, LangPackKey } from "../../lib/langPack"; import appChatsManager from "../../lib/appManagers/appChatsManager"; import PeerTitle from "../peerTitle"; export default class PopupPinMessage { constructor(peerId: number, mid: number, unpin?: true, onConfirm?: () => void) { - let title: LangPackKey, description: LangPackKey, buttons: PopupPeerOptions['buttons'] = [], checkboxes: PopupPeerOptions['checkboxes'] = []; + let title: LangPackKey, description: LangPackKey, descriptionArgs: FormatterArguments, + buttons: PopupPeerOptions['buttons'] = [], checkboxes: PopupPeerOptions['checkboxes'] = []; const canUnpin = appPeersManager.canPinMessage(peerId); @@ -44,6 +45,7 @@ export default class PopupPinMessage { if(canUnpin) { title = 'Popup.Unpin.AllTitle'; description = 'Chat.UnpinAllMessagesConfirmation'; + descriptionArgs = ['' + (appMessagesManager.pinnedMessages[peerId]?.count || 1)]; } else { title = 'Popup.Unpin.HideTitle'; description = 'Popup.Unpin.HideDescription'; @@ -108,6 +110,7 @@ export default class PopupPinMessage { peerId, titleLangKey: title, descriptionLangKey: description, + descriptionLangArgs: descriptionArgs, buttons, checkboxes });