You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-30 04:23:07 +03:00
Revert code moving deleted messages to main timeline (#3858)
* Revert "Move the redaction event to main at the same time we move redacted" This reverts commit378a776815
. Context: https://github.com/vector-im/element-web/issues/26498 * Revert "Don't remove thread info from a thread root when it is redacted" This reverts commit17b61a69c2
. Context: https://github.com/vector-im/element-web/issues/26498 * Revert "Move all related messages into main timeline on redaction" This reverts commitd8fc1795f1
. Context: https://github.com/vector-im/element-web/issues/26498 * Revert "Factor out the code for moving an event to the main timeline" This reverts commit942dfcb84b
. Context: https://github.com/vector-im/element-web/issues/26498 * Revert "Factor out utils in redaction tests" This reverts commit43a0dc56e1
. Context: https://github.com/vector-im/element-web/issues/26498 * Revert "Move redaction event tests into their own describe block" This reverts commit9b0ea80f93
. Context: https://github.com/vector-im/element-web/issues/26498 * Revert "Move redacted messages out of any thread, into main timeline." This reverts commitb94d137398
. Context: https://github.com/vector-im/element-web/issues/26498
This commit is contained in:
@ -27,7 +27,6 @@ import { M_BEACON } from "../../src/@types/beacon";
|
||||
import { MatrixClient } from "../../src/client";
|
||||
import { DecryptionError } from "../../src/crypto/algorithms";
|
||||
import { defer } from "../../src/utils";
|
||||
import { Room } from "../../src/models/room";
|
||||
|
||||
describe("RoomState", function () {
|
||||
const roomId = "!foo:bar";
|
||||
@ -363,11 +362,9 @@ describe("RoomState", function () {
|
||||
});
|
||||
|
||||
it("does not add redacted beacon info events to state", () => {
|
||||
const mockClient = {} as unknown as MockedObject<MatrixClient>;
|
||||
const redactedBeaconEvent = makeBeaconInfoEvent(userA, roomId);
|
||||
const redactionEvent = new MatrixEvent({ type: "m.room.redaction" });
|
||||
const room = new Room(roomId, mockClient, userA);
|
||||
redactedBeaconEvent.makeRedacted(redactionEvent, room);
|
||||
redactedBeaconEvent.makeRedacted(redactionEvent);
|
||||
const emitSpy = jest.spyOn(state, "emit");
|
||||
|
||||
state.setStateEvents([redactedBeaconEvent]);
|
||||
@ -397,13 +394,11 @@ describe("RoomState", function () {
|
||||
});
|
||||
|
||||
it("destroys and removes redacted beacon events", () => {
|
||||
const mockClient = {} as unknown as MockedObject<MatrixClient>;
|
||||
const beaconId = "$beacon1";
|
||||
const beaconEvent = makeBeaconInfoEvent(userA, roomId, { isLive: true }, beaconId);
|
||||
const redactedBeaconEvent = makeBeaconInfoEvent(userA, roomId, { isLive: true }, beaconId);
|
||||
const redactionEvent = new MatrixEvent({ type: "m.room.redaction", redacts: beaconEvent.getId() });
|
||||
const room = new Room(roomId, mockClient, userA);
|
||||
redactedBeaconEvent.makeRedacted(redactionEvent, room);
|
||||
redactedBeaconEvent.makeRedacted(redactionEvent);
|
||||
|
||||
state.setStateEvents([beaconEvent]);
|
||||
const beaconInstance = state.beacons.get(getBeaconInfoIdentifier(beaconEvent));
|
||||
|
Reference in New Issue
Block a user