Display the list of spaces
This commit is contained in:
27
matrixgw_frontend/src/api/matrix/MatrixApiRoom.ts
Normal file
27
matrixgw_frontend/src/api/matrix/MatrixApiRoom.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { APIClient } from "../ApiClient";
|
||||
import type { MatrixEvent } from "./MatrixApiEvent";
|
||||
|
||||
export interface Room {
|
||||
id: string;
|
||||
name?: string;
|
||||
members: string[];
|
||||
avatar?: string;
|
||||
is_space?: boolean;
|
||||
parents: string[];
|
||||
number_unread_messages: number;
|
||||
latest_event?: MatrixEvent;
|
||||
}
|
||||
|
||||
export class MatrixApiRoom {
|
||||
/**
|
||||
* Get the list of joined rooms
|
||||
*/
|
||||
static async ListJoined(): Promise<Room[]> {
|
||||
return (
|
||||
await APIClient.exec({
|
||||
method: "GET",
|
||||
uri: "/matrix/room/joined",
|
||||
})
|
||||
).data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user