From 06903f8376ffd2256c8919ecdc89669a5659b191 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 20 Dec 2016 13:15:15 -0500 Subject: [PATCH] (fix) use the source's domain if none is defined (fixes #3523) --- SoObjects/SOGo/SOGoUserManager.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index 8af8e73f6..7b7a281af 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -834,8 +834,11 @@ static Class NSNullK; { currentSource = [_sources objectForKey: sourceID]; + // Use the provided domain during the lookup. If none is defined, use the source's one + // so if there's a match based on the source's domain, the user ID will be associated + // to the right source. userEntry = [currentSource lookupContactEntryWithUIDorEmail: theUID - inDomain: theDomain]; + inDomain: (theDomain ? theDomain : [currentSource domain])]; if (userEntry) { [theCurrentUser setObject: sourceID forKey: @"SOGoSource"];