Fondation
This commit is contained in:
parent
3c8c38fd72
commit
6c77a33c6f
@ -91,7 +91,9 @@ export async function discoverInfomaniakCalendars(
|
|||||||
|
|
||||||
// Check if this is actually a calendar (has <c:calendar> in resourcetype)
|
// Check if this is actually a calendar (has <c:calendar> in resourcetype)
|
||||||
// Try multiple patterns to be more flexible with XML namespaces
|
// Try multiple patterns to be more flexible with XML namespaces
|
||||||
const dataStr = props.data || '';
|
// Handle both Response and ResponseDataDetailed types
|
||||||
|
const propsData = (props as any).data || '';
|
||||||
|
const dataStr = typeof propsData === 'string' ? propsData : '';
|
||||||
const isCalendar = dataStr.includes('<c:calendar') ||
|
const isCalendar = dataStr.includes('<c:calendar') ||
|
||||||
dataStr.includes('calendar') ||
|
dataStr.includes('calendar') ||
|
||||||
dataStr.includes('urn:ietf:params:xml:ns:caldav');
|
dataStr.includes('urn:ietf:params:xml:ns:caldav');
|
||||||
@ -99,7 +101,7 @@ export async function discoverInfomaniakCalendars(
|
|||||||
logger.debug('[CALDAV] Calendar check result', {
|
logger.debug('[CALDAV] Calendar check result', {
|
||||||
filename: item.filename,
|
filename: item.filename,
|
||||||
isCalendar,
|
isCalendar,
|
||||||
hasData: !!props.data,
|
hasData: !!propsData,
|
||||||
dataLength: dataStr.length,
|
dataLength: dataStr.length,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -109,8 +111,8 @@ export async function discoverInfomaniakCalendars(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Parse XML response to extract calendar name and color
|
// Parse XML response to extract calendar name and color
|
||||||
const displayName = extractDisplayName(props.data);
|
const displayName = extractDisplayName(dataStr);
|
||||||
const color = extractCalendarColor(props.data);
|
const color = extractCalendarColor(dataStr);
|
||||||
|
|
||||||
const calendar = {
|
const calendar = {
|
||||||
id: item.filename.replace(/^\//, '').replace(/\/$/, ''),
|
id: item.filename.replace(/^\//, '').replace(/\/$/, ''),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user