You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-06 12:02:40 +03:00
Revert event-mapper optimisations (#2171)
This commit is contained in:
@@ -29,21 +29,7 @@ export function eventMapperFor(client: MatrixClient, options: MapperOpts): Event
|
||||
const decrypt = options.decrypt !== false;
|
||||
|
||||
function mapper(plainOldJsObject: Partial<IEvent>) {
|
||||
const room = client.getRoom(plainOldJsObject.room_id);
|
||||
let event: MatrixEvent;
|
||||
|
||||
// If the event is already known to the room, let's re-use the model
|
||||
// rather than creating a duplicate
|
||||
if (room) {
|
||||
event = room.findEventById(plainOldJsObject.event_id);
|
||||
}
|
||||
|
||||
// If no event is found or if the event found was only local we can
|
||||
// safely create a new model
|
||||
if (!event || event.status) {
|
||||
event = new MatrixEvent(plainOldJsObject);
|
||||
}
|
||||
|
||||
const event = new MatrixEvent(plainOldJsObject);
|
||||
if (event.isEncrypted()) {
|
||||
if (!preventReEmit) {
|
||||
client.reEmitter.reEmit(event, [
|
||||
|
Reference in New Issue
Block a user