mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-18 17:58:12 +00:00
feat(carddav): fix issue where only personal contacts can be synced on macOS (#1981). When , append the addressbook name as a username suffix to force macOS to treat each book as a distinct account. Usernames must not contain . Install via the provisioning profile. Closes #6033.
This commit is contained in:
1 parent
d16a1a9708
commit
761934af42
13 files changed
+136
-9
No files matched your search
+4
-1
@@ -548,8 +548,11 @@
|
||||
davCurrentUserPrincipal = nil;
|
||||
else
|
||||
{
|
||||
/* loginAlias preserves the <user>!<book> alias used by the
|
||||
per-addressbook CardDAV profile, so that macOS Contacts keeps
|
||||
using the alias URL instead of falling back on the canonical one. */
|
||||
usersUrl = [NSString stringWithFormat: @"%@%@/",
|
||||
[self davURLAsString], login];
|
||||
[self davURLAsString], [activeUser loginAlias]];
|
||||
userHREF = davElementWithContent (@"href", XMLNS_WEBDAV, usersUrl);
|
||||
davCurrentUserPrincipal
|
||||
= [davElementWithContent (@"current-user-principal",
|
||||
|
||||
@@ -387,6 +387,10 @@ static BOOL debugLeaks;
|
||||
//Here the user is expected to be name or name@domain.com
|
||||
//However iOS 18.4 sanitize the caldav url and put %40 instead of @
|
||||
login = [login stringByReplacingOccurrencesOfString: @"%40" withString: @"@"];
|
||||
/* When SOGoCarddavSingleAddressBookProfile is on, login may carry a
|
||||
<user>!<book> alias suffix; userWithLogin: strips it internally, but we
|
||||
keep the alias as the folder name so generated hrefs preserve the !book
|
||||
discriminator. */
|
||||
user = [SOGoUser userWithLogin: login roles: nil];
|
||||
}
|
||||
if (user)
|
||||
|
||||
Reference in new issue
Block a user