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

Commit

Permalink
Use redaction enum event type rather than hardcoded string (#8071)
Browse files Browse the repository at this point in the history
  • Loading branch information
Germain authored Mar 17, 2022
1 parent 176e49e commit 4e4ce65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/views/dialogs/MessageEditHistoryDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default class MessageEditHistoryDialog extends React.PureComponent<IProps
const pendingEvents = room.getPendingEvents();
for (const e of newEvents) {
const pendingRedaction = pendingEvents.find(pe => {
return pe.getType() === "m.room.redaction" && pe.getAssociatedId() === e.getId();
return pe.getType() === EventType.RoomRedaction && pe.getAssociatedId() === e.getId();
});
if (pendingRedaction) {
e.markLocallyRedacted(pendingRedaction);
Expand Down
12 changes: 10 additions & 2 deletions test/utils/export-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ limitations under the License.
*/

import { renderToString } from "react-dom/server";
import { IContent, MatrixClient, MatrixEvent, Room, RoomMember, RelationType } from "matrix-js-sdk/src/matrix";
import {
IContent,
MatrixClient,
MatrixEvent,
Room,
RoomMember,
RelationType,
EventType,
} from "matrix-js-sdk/src/matrix";

import { MatrixClientPeg } from "../../src/MatrixClientPeg";
import { IExportOptions, ExportType, ExportFormat } from "../../src/utils/exportUtils/exportUtils";
Expand Down Expand Up @@ -71,7 +79,7 @@ describe('export', function() {
"origin_server_ts": ts0 + i*1000,
"redacts": "$9999999999999999999999999999999999999999998",
"sender": "@me:here",
"type": "m.room.redaction",
"type": EventType.RoomRedaction,
"unsigned": {
"age": 94,
"transaction_id": "m1111111111.1",
Expand Down

0 comments on commit 4e4ce65

Please sign in to comment.