Skip to content

Commit

Permalink
Render unknown events as announcements
Browse files Browse the repository at this point in the history
Signed-off-by: Mirian Margiani <[email protected]>
  • Loading branch information
ichthyosaurus committed Dec 5, 2024
1 parent 9bedb88 commit 478718f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 53 deletions.
11 changes: 2 additions & 9 deletions src/domain/session/room/timeline/tiles/UnknownEventTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ export class UnknownEventTile extends SimpleTile {
return "unknown-event";
}

get details() {
const eventType = this._entry.eventType;
const content = this._entry.content;

if (content.msgtype) {
return this.i18n`You received a message that this app cannot display (event “${eventType}”, message type “${content.msgtype}”). Please report this issue.`
} else {
return this.i18n`You received a message that this app cannot display (event “${eventType}”). Please report this issue.`
}
get announcement() {
return this.i18n`You received a message that this app cannot display (event “${this._entry.eventType}”). Please report this issue.`
}
}
4 changes: 1 addition & 3 deletions src/platform/web/ui/session/room/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ import {GapView} from "./timeline/GapView.js";
import {CallTileView} from "./timeline/CallTileView";
import {DateHeaderView} from "./timeline/DateHeaderView";
import {VerificationTileView} from "./timeline/VerificationTileView";
import {UnknownEventView} from "./timeline/UnknownEventView";
import type {TileViewConstructor} from "./TimelineView";

export function viewClassForTile(vm: ITile): TileViewConstructor {
switch (vm.shape) {
case TileShape.Gap:
return GapView;
case TileShape.Announcement:
case TileShape.UnknownEvent:
return AnnouncementView;
case TileShape.Message:
case TileShape.MessageStatus:
Expand All @@ -58,8 +58,6 @@ export function viewClassForTile(vm: ITile): TileViewConstructor {
return DateHeaderView;
case TileShape.Verification:
return VerificationTileView;
case TileShape.UnknownEvent:
return UnknownEventView;
default:
throw new Error(`Tiles of shape "${vm.shape}" are not supported, check the tileClassForEntry function in the view model`);
}
Expand Down
41 changes: 0 additions & 41 deletions src/platform/web/ui/session/room/timeline/UnknownEventView.js

This file was deleted.

0 comments on commit 478718f

Please sign in to comment.