Display started polls in timeline (without votes) (behind labs setting) (#7088)
* Display started polls in timeline (without votes) * Update i18n info * Keep original background colour of poll options, even on hover * Show full avatar above a poll message
This commit is contained in:
parent
8ea551fb6d
commit
431b69ee49
9 changed files with 229 additions and 5 deletions
|
@ -27,6 +27,7 @@ import { MediaEventHelper } from "../../../utils/MediaEventHelper";
|
|||
import { ReactAnyComponent } from "../../../@types/common";
|
||||
import { EventType, MsgType } from "matrix-js-sdk/src/@types/event";
|
||||
import { IBodyProps } from "./IBodyProps";
|
||||
import { POLL_START_EVENT_TYPE } from '../../../polls/consts';
|
||||
|
||||
// onMessageAllowed is handled internally
|
||||
interface IProps extends Omit<IBodyProps, "onMessageAllowed"> {
|
||||
|
@ -111,6 +112,15 @@ export default class MessageEvent extends React.Component<IProps> implements IMe
|
|||
// Fallback to UnknownBody otherwise if not redacted
|
||||
BodyType = UnknownBody;
|
||||
}
|
||||
|
||||
if (type && type === POLL_START_EVENT_TYPE.name) {
|
||||
// TODO: this can all disappear when Polls comes out of labs -
|
||||
// instead, add something like this into this.evTypes:
|
||||
// [EventType.Poll]: "messages.MPollBody"
|
||||
if (SettingsStore.getValue("feature_polls")) {
|
||||
BodyType = sdk.getComponent('messages.MPollBody');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SettingsStore.getValue("feature_mjolnir")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue