You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Allow finding group DMs by members in spotlight (#8922)
This commit is contained in:
committed by
GitHub
parent
7e47749ce2
commit
d4a4eeaf63
@ -53,6 +53,12 @@ declare global {
|
||||
* @param data The data to store.
|
||||
*/
|
||||
setAccountData(type: string, data: object): Chainable<{}>;
|
||||
/**
|
||||
* Gets the list of DMs with a given user
|
||||
* @param userId The ID of the user
|
||||
* @return the list of DMs with that user
|
||||
*/
|
||||
getDmRooms(userId: string): Chainable<string[]>;
|
||||
/**
|
||||
* Boostraps cross-signing.
|
||||
*/
|
||||
@ -65,6 +71,12 @@ Cypress.Commands.add("getClient", (): Chainable<MatrixClient | undefined> => {
|
||||
return cy.window({ log: false }).then(win => win.mxMatrixClientPeg.matrixClient);
|
||||
});
|
||||
|
||||
Cypress.Commands.add("getDmRooms", (userId: string): Chainable<string[]> => {
|
||||
return cy.getClient()
|
||||
.then(cli => cli.getAccountData("m.direct")?.getContent<Record<string, string[]>>())
|
||||
.then(dmRoomMap => dmRoomMap[userId] ?? []);
|
||||
});
|
||||
|
||||
Cypress.Commands.add("createRoom", (options: ICreateRoomOpts): Chainable<string> => {
|
||||
return cy.window({ log: false }).then(async win => {
|
||||
const cli = win.mxMatrixClientPeg.matrixClient;
|
||||
|
Reference in New Issue
Block a user