Live location sharing: don't group beacon info with room creation summary (#8468)
* dont group beacon info with room creation summary Signed-off-by: Kerry Archibald <kerrya@element.io> * remove debugs Signed-off-by: Kerry Archibald <kerrya@element.io> * add comment Signed-off-by: Kerry Archibald <kerrya@element.io> * update comment Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
3b1e715854
commit
c5633a24fe
2 changed files with 34 additions and 1 deletions
|
@ -23,6 +23,7 @@ import { MatrixEvent } from 'matrix-js-sdk/src/models/event';
|
|||
import { Relations } from "matrix-js-sdk/src/models/relations";
|
||||
import { logger } from 'matrix-js-sdk/src/logger';
|
||||
import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
|
||||
import { M_BEACON_INFO } from 'matrix-js-sdk/src/@types/beacon';
|
||||
|
||||
import shouldHideEvent from '../../shouldHideEvent';
|
||||
import { wantsDateSeparator } from '../../DateUtils';
|
||||
|
@ -1079,7 +1080,7 @@ abstract class BaseGrouper {
|
|||
|
||||
// Wrap initial room creation events into a GenericEventListSummary
|
||||
// Grouping only events sent by the same user that sent the `m.room.create` and only until
|
||||
// the first non-state event or membership event which is not regarding the sender of the `m.room.create` event
|
||||
// the first non-state event, beacon_info event or membership event which is not regarding the sender of the `m.room.create` event
|
||||
class CreationGrouper extends BaseGrouper {
|
||||
static canStartGroup = function(panel: MessagePanel, ev: MatrixEvent): boolean {
|
||||
return ev.getType() === EventType.RoomCreate;
|
||||
|
@ -1098,9 +1099,15 @@ class CreationGrouper extends BaseGrouper {
|
|||
&& (ev.getStateKey() !== createEvent.getSender() || ev.getContent()["membership"] !== "join")) {
|
||||
return false;
|
||||
}
|
||||
// beacons are not part of room creation configuration
|
||||
// should be shown in timeline
|
||||
if (M_BEACON_INFO.matches(ev.getType())) {
|
||||
return false;
|
||||
}
|
||||
if (ev.isState() && ev.getSender() === createEvent.getSender()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue