88 */ 
99namespace  OCA \DAV \CalDAV ;
1010
11+ use  OCA \DAV \Db \Property ;
12+ use  OCA \DAV \Db \PropertyMapper ;
1113use  OCP \Calendar \ICalendarProvider ;
1214use  OCP \IConfig ;
1315use  OCP \IL10N ;
@@ -20,6 +22,7 @@ public function __construct(
2022		private  IL10N $ l10n
2123		private  IConfig $ config
2224		private  LoggerInterface $ logger
25+ 		private  PropertyMapper $ propertyMapper
2326	) {
2427	}
2528
@@ -35,6 +38,7 @@ public function getCalendars(string $principalUri, array $calendarUris = []): ar
3538
3639		$ iCalendars
3740		foreach  ($ calendarInfosas  $ calendarInfo
41+ 			$ calendarInfoarray_merge ($ calendarInfo$ this getAdditionalProperties ($ calendarInfo'principaluri ' ], $ calendarInfo'uri ' ]));
3842			$ calendarnew  Calendar ($ this calDavBackend , $ calendarInfo$ this l10n , $ this config , $ this logger );
3943			$ iCalendarsnew  CalendarImpl (
4044				$ calendar
@@ -44,4 +48,23 @@ public function getCalendars(string $principalUri, array $calendarUris = []): ar
4448		}
4549		return  $ iCalendars
4650	}
51+ 
52+ 	public  function  getAdditionalProperties (string  $ principalUristring  $ calendarUriarray  {
53+ 		$ userstr_replace ('principals/users/ ' , '' , $ principalUri
54+ 		$ path'calendars/ '  . $ user'/ '  . $ calendarUri
55+ 
56+ 		$ properties$ this propertyMapper ->findPropertiesByPath ($ user$ path
57+ 
58+ 		$ list
59+ 		foreach  ($ propertiesas  $ property
60+ 			if  ($ propertyinstanceof  Property) {
61+ 				$ list$ propertygetPropertyname ()] = match  ($ propertygetPropertyname ()) {
62+ 					'{http://owncloud.org/ns}calendar-enabled '  => (bool )$ propertygetPropertyvalue (),
63+ 					default  => $ propertygetPropertyvalue ()
64+ 				};
65+ 			}
66+ 		}
67+ 
68+ 		return  $ list
69+ 	}
4770}
0 commit comments