Commit fb0552de authored by Ricki Hirner's avatar Ricki Hirner 🐑

Find collections when they're identical with their home set

parent 03c15a69
......@@ -228,7 +228,9 @@ public class DavService extends Service {
DavResource dav = new DavResource(httpClient, homeSet);
try {
dav.propfind(1, CollectionInfo.DAV_PROPERTIES);
for (DavResource member : dav.members) {
Set<DavResource> selfAndMembers = new HashSet<>(dav.members);
selfAndMembers.add(dav);
for (DavResource member : selfAndMembers) {
CollectionInfo info = CollectionInfo.fromDavResource(member);
info.confirmed = true;
App.log.log(Level.FINE, "Found collection", info);
......
......@@ -209,8 +209,11 @@ public class DavResourceFinder {
// Does the collection refer to address book homesets?
AddressbookHomeSet homeSets = (AddressbookHomeSet)dav.properties.get(AddressbookHomeSet.NAME);
if (homeSets != null)
for (String href : homeSets.hrefs)
config.homeSets.add(UrlUtils.withTrailingSlash(dav.location.resolve(href)).uri());
for (String href : homeSets.hrefs) {
HttpUrl location = UrlUtils.withTrailingSlash(dav.location.resolve(href));
log.info("Found addressbook home-set at " + location);
config.homeSets.add(location.uri());
}
}
protected void rememberIfCalendarOrHomeset(@NonNull DavResource dav, @NonNull Configuration.ServiceInfo config) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment