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 {
BeaconIdentifier,
BeaconEvent,
MatrixEvent,
RelationType,
Room,
RoomMember,
RoomState,
@ -449,20 +448,12 @@ export class OwnBeaconStore extends AsyncStoreWithClient<OwnBeaconStoreState> {
...update,
};
const newContent = makeBeaconInfoContent(timeout,
const updateContent = makeBeaconInfoContent(timeout,
live,
description,
assetType,
timestamp,
);
const updateContent = {
...newContent,
"m.new_content": newContent,
"m.relates_to": {
"rel_type": RelationType.Replace,
"event_id": beacon.beaconInfoId,
},
};
await this.matrixClient.unstable_setLiveBeacon(beacon.roomId, updateContent);
};