Move all polls processing to events-sdk & prep for stable polls (#7517)
* Move all polls processing to events-sdk This makes polls support the full range of extensible events (both parsing and generation). * Appease the linter * Fix & update tests * Update events-sdk for polls bugfix * Update events-sdk for typechecking * Add missing type cast * Update per review
This commit is contained in:
parent
12e967a97c
commit
65987e6b72
17 changed files with 727 additions and 299 deletions
|
@ -19,8 +19,8 @@ import React, { ReactElement } from 'react';
|
|||
import { EventStatus, MatrixEvent } from 'matrix-js-sdk/src/models/event';
|
||||
import { EventType, RelationType } from "matrix-js-sdk/src/@types/event";
|
||||
import { Relations } from 'matrix-js-sdk/src/models/relations';
|
||||
import { POLL_START_EVENT_TYPE } from "matrix-js-sdk/src/@types/polls";
|
||||
import { LOCATION_EVENT_TYPE } from 'matrix-js-sdk/src/@types/location';
|
||||
import { M_POLL_START } from "matrix-events-sdk";
|
||||
|
||||
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
||||
import dis from '../../../dispatcher/dispatcher';
|
||||
|
@ -140,7 +140,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
|||
|
||||
private canEndPoll(mxEvent: MatrixEvent): boolean {
|
||||
return (
|
||||
POLL_START_EVENT_TYPE.matches(mxEvent.getType()) &&
|
||||
M_POLL_START.matches(mxEvent.getType()) &&
|
||||
this.state.canRedact &&
|
||||
!isPollEnded(mxEvent, MatrixClientPeg.get(), this.props.getRelationsForEvent)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue