Skip to content

Commit

Permalink
(fix) fixed addressbrook-only source entires having a c_uid set
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed Nov 6, 2015
1 parent 106c6a2 commit ef7de7c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -32,6 +32,7 @@ Bug fixes
- fixed wrong comparison of meta vs. META tag in HTML mails
- fixed popup menu position when moved to the left (#3381)
- fixed dialog position when at the bottom of the window (#2646, #3378)
- fixed addressbrook-only source entires having a c_uid set

2.3.2 (2015-09-16)
------------------
Expand Down
13 changes: 11 additions & 2 deletions SoObjects/Contacts/SOGoContactSourceFolder.m
Expand Up @@ -47,6 +47,7 @@
#import <SOGo/NSObject+DAV.h>
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoSource.h>
#import <SOGo/SOGoUserManager.h>
#import <SOGo/SOGoUserSettings.h>
#import <SOGo/SOGoSystemDefaults.h>
#import <SOGo/WORequest+SOGo.h>
Expand Down Expand Up @@ -225,8 +226,16 @@ - (NSDictionary *) _flattenedRecord: (NSDictionary *) oldRecord
NSObject <SOGoSource> *recordSource;

newRecord = [NSMutableDictionary dictionaryWithCapacity: 8];
[newRecord setObject: [oldRecord objectForKey: @"c_uid"]
forKey: @"c_uid"];

// We set the c_uid only for authentication sources. SOGoUserSources set
// with canAuthenticate = NO and isAddressBook = YES have absolutely *NO REASON*
// to have entries with a c_uid. These can collide with real uids.
if ([[[[SOGoUserManager sharedUserManager] metadataForSourceID: [source sourceID]] objectForKey: @"canAuthenticate"] boolValue])
{
[newRecord setObject: [oldRecord objectForKey: @"c_uid"]
forKey: @"c_uid"];
}

[newRecord setObject: [oldRecord objectForKey: @"c_name"]
forKey: @"c_name"];

Expand Down

0 comments on commit ef7de7c

Please sign in to comment.