LLS: Remove beacon info illegal replace relation (#8390)

* dont apply illegal replace relation to beacon_info event

Signed-off-by: Kerry Archibald <kerrya@element.io>

* only display tiles for beacon infos with live prop

Signed-off-by: Kerry Archibald <kerrya@element.io>

* copyrights

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry 2022-04-22 13:38:27 +02:00 committed by GitHub
parent 763edb7ab9
commit a3a7c60dd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 37 deletions

View file

@ -20,7 +20,6 @@ import {
BeaconEvent,
getBeaconInfoIdentifier,
MatrixEvent,
RelationType,
RoomStateEvent,
RoomMember,
} from "matrix-js-sdk/src/matrix";
@ -473,14 +472,6 @@ describe('OwnBeaconStore', () => {
const expectedUpdateContent = {
...prevEventContent,
live: false,
["m.new_content"]: {
...prevEventContent,
live: false,
},
["m.relates_to"]: {
event_id: alicesRoom1BeaconInfo.getId(),
rel_type: RelationType.Replace,
},
};
expect(mockClient.unstable_setLiveBeacon).toHaveBeenCalledWith(
room1Id,
@ -650,14 +641,6 @@ describe('OwnBeaconStore', () => {
const expectedUpdateContent = {
...prevEventContent,
live: false,
["m.new_content"]: {
...prevEventContent,
live: false,
},
["m.relates_to"]: {
event_id: alicesRoom1BeaconInfo.getId(),
rel_type: RelationType.Replace,
},
};
expect(mockClient.unstable_setLiveBeacon).toHaveBeenCalledWith(
room1Id,
@ -683,14 +666,6 @@ describe('OwnBeaconStore', () => {
const expectedUpdateContent = {
...prevEventContent,
live: false,
["m.new_content"]: {
...prevEventContent,
live: false,
},
["m.relates_to"]: {
event_id: alicesRoom1BeaconInfo.getId(),
rel_type: RelationType.Replace,
},
};
expect(mockClient.unstable_setLiveBeacon).toHaveBeenCalledWith(
room1Id,