mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-29 04:43:26 +01:00
Initial Poll message receive support
This commit is contained in:
@@ -96,6 +96,10 @@ import { isPaymentNotificationEvent } from '../../types/Payment.js';
|
||||
import type { AnyPaymentEvent } from '../../types/Payment.js';
|
||||
import { getPaymentEventDescription } from '../../messages/helpers.js';
|
||||
import { PanelType } from '../../types/Panels.js';
|
||||
import {
|
||||
type PollMessageAttribute,
|
||||
isPollReceiveEnabled,
|
||||
} from '../../types/Polls.js';
|
||||
import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js';
|
||||
import { RenderLocation } from './MessageTextRenderer.js';
|
||||
import { UserText } from '../UserText.js';
|
||||
@@ -301,6 +305,7 @@ export type PropsData = {
|
||||
attachments?: ReadonlyArray<AttachmentForUIType>;
|
||||
giftBadge?: GiftBadgeType;
|
||||
payment?: AnyPaymentEvent;
|
||||
poll?: PollMessageAttribute;
|
||||
quote?: {
|
||||
conversationColor: ConversationColorType;
|
||||
conversationTitle: string;
|
||||
@@ -2074,6 +2079,23 @@ export class Message extends React.PureComponent<Props, State> {
|
||||
);
|
||||
}
|
||||
|
||||
public renderPoll(): JSX.Element | null {
|
||||
const { poll, direction } = this.props;
|
||||
if (!poll || !isPollReceiveEnabled()) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<div
|
||||
className={classNames(
|
||||
'module-message__text',
|
||||
`module-message__text--${direction}`
|
||||
)}
|
||||
>
|
||||
<pre>{JSON.stringify(poll, null, 2)}</pre>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
#doubleCheckMissingQuoteReference = () => {
|
||||
return this.props.doubleCheckMissingQuoteReference(this.props.id);
|
||||
};
|
||||
@@ -2973,6 +2995,7 @@ export class Message extends React.PureComponent<Props, State> {
|
||||
{this.renderPreview()}
|
||||
{this.renderAttachmentTooBig()}
|
||||
{this.renderPayment()}
|
||||
{this.renderPoll()}
|
||||
{this.renderEmbeddedContact()}
|
||||
{this.renderText()}
|
||||
{this.renderUndownloadableTextAttachment()}
|
||||
|
||||
Reference in New Issue
Block a user