Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Don't show polls in timeline if polls are disabled #7332

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/components/structures/MessagePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import TileErrorBoundary from '../views/messages/TileErrorBoundary';
import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks";
import EditorStateTransfer from "../../utils/EditorStateTransfer";
import { Action } from '../../dispatcher/actions';
import { POLL_START_EVENT_TYPE } from '../../polls/consts';

const CONTINUATION_MAX_INTERVAL = 5 * 60 * 1000; // 5 minutes
const continuedTypes = [EventType.Sticker, EventType.RoomMessage];
Expand Down Expand Up @@ -461,6 +462,13 @@ export default class MessagePanel extends React.Component<IProps, IState> {
return false; // no tile = no show
}

if (
POLL_START_EVENT_TYPE.matches(mxEv.getType()) &&
!SettingsStore.getValue("feature_polls")
) {
return false;
}
andybalaam marked this conversation as resolved.
Show resolved Hide resolved

// Always show highlighted event
if (this.props.highlightedEventId === mxEv.getId()) return true;

Expand Down