KI-AGENT: Ungelesene Chat Badges in Mobile App anzeigen
This commit is contained in:
@@ -292,6 +292,8 @@ export type MatrixSyncResponse = {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type MatrixUnreadCounts = Record<string, { count?: number; mentions?: number }>;
|
||||
|
||||
function buildUrl(path: string): string {
|
||||
if (path.startsWith('http://') || path.startsWith('https://')) {
|
||||
return path;
|
||||
@@ -408,6 +410,11 @@ export async function fetchMatrixRooms(token: string): Promise<MatrixRoom[]> {
|
||||
];
|
||||
}
|
||||
|
||||
export async function fetchMatrixUnreadCounts(token: string): Promise<MatrixUnreadCounts> {
|
||||
const response = await apiRequest<{ rooms?: MatrixUnreadCounts }>('/api/communication/matrix/unread', { token });
|
||||
return response.rooms || {};
|
||||
}
|
||||
|
||||
export async function fetchMatrixUsers(token: string): Promise<MatrixUser[]> {
|
||||
const response = await apiRequest<{ users?: MatrixUser[] }>('/api/communication/matrix/users', { token });
|
||||
return response.users || [];
|
||||
|
||||
Reference in New Issue
Block a user