Don't show replaced calls in the timeline (#7452)

* Don't show replaced calls in the timeline

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Revert changes to CallEvent

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Add option to force hide event

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Hide replaced calls

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2022-01-31 17:09:34 +01:00 committed by GitHub
parent 991257cbc3
commit a55482b0ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 6 deletions

View file

@ -177,7 +177,7 @@ export function getMessageModerationState(mxEvent: MatrixEvent): MessageModerati
return MessageModerationState.HIDDEN_TO_CURRENT_USER;
}
export function getEventDisplayInfo(mxEvent: MatrixEvent): {
export function getEventDisplayInfo(mxEvent: MatrixEvent, hideEvent?: boolean): {
isInfoMessage: boolean;
tileHandler: string;
isBubbleMessage: boolean;
@ -245,7 +245,7 @@ export function getEventDisplayInfo(mxEvent: MatrixEvent): {
// source tile when there's no regular tile for an event and also for
// replace relations (which otherwise would display as a confusing
// duplicate of the thing they are replacing).
if (SettingsStore.getValue("showHiddenEventsInTimeline") && !haveTileForEvent(mxEvent)) {
if ((hideEvent || !haveTileForEvent(mxEvent)) && SettingsStore.getValue("showHiddenEventsInTimeline")) {
tileHandler = "messages.ViewSourceEvent";
isBubbleMessage = false;
// Reuse info message avatar and sender profile styling