From 67d0d9586986337d5e73769df5e5484d47d6e182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20Garc=C3=ADa?= Date: Fri, 26 Jun 2015 09:35:26 +0200 Subject: [PATCH] Revert "Revert "Fixed mess regarding uid/realUID"" This reverts commit 96d88de564f36e45bf9d82258c1378b881532b7f. --- SoObjects/SOGo/SOGoUser.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 91d3b1b5a..c1b0f7603 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -197,8 +197,12 @@ // When the user is associated to a domain, the [SOGoUser login] // method returns the combination login@domain while // [SOGoUser loginInDomain] only returns the login. - uid = [NSString stringWithString: realUID]; - realUID = [NSString stringWithFormat: @"%@@%@", realUID, domain]; + r = [realUID rangeOfString: domain options: NSBackwardsSearch|NSCaseInsensitiveSearch]; + + if (r.location != NSNotFound) + uid = [realUID substringToIndex: r.location-1]; + else + uid = [NSString stringWithString: realUID]; } }