KI-AGENT: Ungelesene Chat Badges in Mobile App anzeigen

This commit is contained in:
2026-05-22 18:51:33 +02:00
parent 00da371dfb
commit f150cfd740
3 changed files with 69 additions and 5 deletions

View File

@@ -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 || [];