Various fixes (#4836)
This commit is contained in:
parent
629f979c5a
commit
eddce446de
@ -24,7 +24,7 @@ import { buildApiMessage, setMessageBuilderCurrentUserId } from '../apiBuilders/
|
||||
import { buildApiPeerId } from '../apiBuilders/peers';
|
||||
import { buildApiStory } from '../apiBuilders/stories';
|
||||
import { buildApiUser, buildApiUserFullInfo } from '../apiBuilders/users';
|
||||
import { buildInputPeerFromLocalDb } from '../gramjsBuilders';
|
||||
import { buildInputPeerFromLocalDb, getEntityTypeById } from '../gramjsBuilders';
|
||||
import {
|
||||
addEntitiesToLocalDb, addMessageToLocalDb, addStoryToLocalDb, addUserToLocalDb, isResponseUpdate, log,
|
||||
} from '../helpers';
|
||||
@ -465,10 +465,11 @@ export async function repairFileReference({
|
||||
}
|
||||
|
||||
async function repairMessageMedia(peerId: string, messageId: number) {
|
||||
const type = getEntityTypeById(peerId);
|
||||
const peer = buildInputPeerFromLocalDb(peerId);
|
||||
if (!peer) return false;
|
||||
const result = await invokeRequest(
|
||||
peer
|
||||
type === 'channel'
|
||||
? new GramJs.channels.GetMessages({
|
||||
channel: peer,
|
||||
id: [new GramJs.InputMessageID({ id: messageId })],
|
||||
|
||||
@ -31,6 +31,7 @@ interface OwnProps {
|
||||
forcePlayback?: boolean;
|
||||
focusedQuote?: string;
|
||||
isInSelectMode?: boolean;
|
||||
canBeEmpty?: boolean;
|
||||
}
|
||||
|
||||
const MIN_CUSTOM_EMOJIS_FOR_SHARED_CANVAS = 3;
|
||||
@ -52,6 +53,7 @@ function MessageText({
|
||||
forcePlayback,
|
||||
focusedQuote,
|
||||
isInSelectMode,
|
||||
canBeEmpty,
|
||||
}: OwnProps) {
|
||||
// eslint-disable-next-line no-null/no-null
|
||||
const sharedCanvasRef = useRef<HTMLCanvasElement>(null);
|
||||
@ -80,7 +82,7 @@ function MessageText({
|
||||
return customEmojisCount >= MIN_CUSTOM_EMOJIS_FOR_SHARED_CANVAS;
|
||||
}, [entities]) || 0;
|
||||
|
||||
if (!text) {
|
||||
if (!text && !canBeEmpty) {
|
||||
return <span className="content-unsupported">{CONTENT_NOT_SUPPORTED}</span>;
|
||||
}
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ const StickerView: FC<OwnProps> = ({
|
||||
const thumbData = customColor ? thumbDataUri : (previewMediaData || thumbDataUri);
|
||||
|
||||
const shouldForcePreview = isUnsupportedVideo || (isStatic && isSmall);
|
||||
fullMediaHash ||= shouldForcePreview ? previewMediaHash : `sticker${id}`;
|
||||
fullMediaHash = shouldForcePreview ? previewMediaHash : (fullMediaHash || `sticker${id}`);
|
||||
|
||||
// If preloaded preview is forced, it will render as thumb, so no need to load it again
|
||||
const shouldSkipFullMedia = Boolean(fullMediaHash === previewMediaHash && previewMediaData);
|
||||
|
||||
@ -980,6 +980,7 @@ const Message: FC<OwnProps & StateProps> = ({
|
||||
observeIntersectionForPlaying={observeIntersectionForPlaying}
|
||||
withTranslucentThumbs={isCustomShape}
|
||||
isInSelectMode={isInSelectMode}
|
||||
canBeEmpty={hasFactCheck}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user