Allow finding group DMs by members in spotlight (#8922)
This commit is contained in:
parent
7e47749ce2
commit
d4a4eeaf63
4 changed files with 65 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue