You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Expire video member events after 1 hour (#8776)
* Expire video member events after 1 hour * Iterate based on feedback * Validate the types of video member events better * Even more parentheses
This commit is contained in:
@@ -18,7 +18,7 @@ import { EventEmitter } from "events";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
|
||||
import { mkEvent } from "./test-utils";
|
||||
import { VIDEO_CHANNEL_MEMBER } from "../../src/utils/VideoChannelUtils";
|
||||
import { VIDEO_CHANNEL_MEMBER, STUCK_DEVICE_TIMEOUT_MS } from "../../src/utils/VideoChannelUtils";
|
||||
import VideoChannelStore, { VideoChannelEvent, IJitsiParticipant } from "../../src/stores/VideoChannelStore";
|
||||
|
||||
export class StubVideoChannelStore extends EventEmitter {
|
||||
@@ -52,11 +52,14 @@ export const stubVideoChannelStore = (): StubVideoChannelStore => {
|
||||
return store;
|
||||
};
|
||||
|
||||
export const mkVideoChannelMember = (userId: string, devices: string[]): MatrixEvent => mkEvent({
|
||||
export const mkVideoChannelMember = (userId: string, devices: string[], expiresAt?: number): MatrixEvent => mkEvent({
|
||||
event: true,
|
||||
type: VIDEO_CHANNEL_MEMBER,
|
||||
room: "!1:example.org",
|
||||
user: userId,
|
||||
skey: userId,
|
||||
content: { devices },
|
||||
content: {
|
||||
devices,
|
||||
expires_ts: expiresAt == null ? Date.now() + STUCK_DEVICE_TIMEOUT_MS : expiresAt,
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user