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

feature flag for displaying edits as well #3132

Merged
merged 3 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion src/components/structures/MessagePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ module.exports = React.createClass({
},

componentWillMount: function() {
this._editingEnabled = SettingsStore.isFeatureEnabled("feature_message_editing");
// the event after which we put a visible unread marker on the last
// render cycle; null if readMarkerVisible was false or the RM was
// suppressed (eg because it was at the end of the timeline)
Expand Down Expand Up @@ -585,7 +586,7 @@ module.exports = React.createClass({
<EventTile mxEvent={mxEv}
continuation={continuation}
isRedacted={mxEv.isRedacted()}
replacingEventId={mxEv.replacingEventId()}
replacingEventId={this._editingEnabled && mxEv.replacingEventId()}
editState={isEditing && this.props.editState}
onHeightChanged={this._onHeightChanged}
readReceipts={readReceipts}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/EventTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ module.exports.haveTileForEvent = function(e) {
if (e.isRedacted() && !isMessageEvent(e)) return false;

// No tile for replacement events since they update the original tile
if (e.isRelation("m.replace")) return false;
if (e.isRelation("m.replace") && SettingsStore.isFeatureEnabled("feature_message_editing")) return false;

const handler = getHandlerTile(e);
if (handler === undefined) return false;
Expand Down
4 changes: 2 additions & 2 deletions src/shouldHideEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default function shouldHideEvent(ev) {
// Hide redacted events
if (ev.isRedacted() && !isEnabled('showRedactions')) return true;

// Hide replacement events since they update the original tile
if (ev.isRelation("m.replace")) return true;
// Hide replacement events since they update the original tile (if enabled)
if (ev.isRelation("m.replace") && SettingsStore.isFeatureEnabled("feature_message_editing")) return true;

const eventDiff = memberEventDiff(ev);

Expand Down