mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
Timeline: Handle height change due to pending voice note
This commit is contained in:
@@ -11,3 +11,12 @@ export function getBubbleProps(attributes: any) {
|
||||
|
||||
return model.getPropsForBubble();
|
||||
}
|
||||
|
||||
export function isVoiceFlag(flags: any): boolean {
|
||||
// @ts-ignore
|
||||
const protoFlags = window.textsecure.protobuf.AttachmentPointer.Flags;
|
||||
const VOICE_MESSAGE_FLAG = protoFlags.VOICE_MESSAGE;
|
||||
|
||||
// tslint:disable-next-line no-bitwise
|
||||
return Boolean(flags && flags & VOICE_MESSAGE_FLAG);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
without,
|
||||
} from 'lodash';
|
||||
import { trigger } from '../../shims/events';
|
||||
import { isVoiceFlag } from '../../shims/Whisper';
|
||||
import { NoopActionType } from './noop';
|
||||
import {
|
||||
AttachmentType,
|
||||
@@ -541,7 +542,8 @@ function hasMessageHeightChanged(
|
||||
previousAttachments[0].pending &&
|
||||
messageAttachments[0] &&
|
||||
(isImageAttachment(messageAttachments[0]) ||
|
||||
isVideoAttachment(messageAttachments[0])) &&
|
||||
isVideoAttachment(messageAttachments[0]) ||
|
||||
isVoiceFlag(messageAttachments[0].flags)) &&
|
||||
!messageAttachments[0].pending;
|
||||
if (singleVisualAttachmentNoLongerPending) {
|
||||
return true;
|
||||
|
||||
@@ -38,6 +38,7 @@ export interface AttachmentType {
|
||||
url: string;
|
||||
contentType: MIME.MIMEType;
|
||||
};
|
||||
flags?: number;
|
||||
thumbnail?: {
|
||||
height: number;
|
||||
width: number;
|
||||
|
||||
Reference in New Issue
Block a user