mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 00:45:09 +00:00
propagate from branch 'ca.inverse.sogo.1_3_12' (head f5ba6db440f5a8ba817af65dea12b4a616fdfe71)
to branch 'ca.inverse.sogo' (head df5dd81d62db331ba5c8de9f2257f9430c586534) Monotone-Parent: df5dd81d62db331ba5c8de9f2257f9430c586534 Monotone-Parent: f5ba6db440f5a8ba817af65dea12b4a616fdfe71 Monotone-Revision: 31373520d86c320c1658f22e3bde2eee178c2003 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-01-09T16:38:18 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -103,44 +103,51 @@
|
||||
sourceID = [udSource objectForKey: @"id"];
|
||||
if ([sourceID length] > 0)
|
||||
{
|
||||
type = [[udSource objectForKey: @"type"] lowercaseString];
|
||||
c = NSClassFromString([_registry sourceClassForType: type]);
|
||||
sogoSource = [c sourceFromUDSource: udSource inDomain: domain];
|
||||
if (sourceID)
|
||||
[_sources setObject: sogoSource forKey: sourceID];
|
||||
else
|
||||
[self errorWithFormat: @"id field missing in an user source,"
|
||||
@" check the SOGoUserSources defaults"];
|
||||
metadata = [NSMutableDictionary dictionary];
|
||||
if (domain)
|
||||
[metadata setObject: domain forKey: @"domain"];
|
||||
value = [udSource objectForKey: @"canAuthenticate"];
|
||||
if (value)
|
||||
[metadata setObject: value forKey: @"canAuthenticate"];
|
||||
value = [udSource objectForKey: @"isAddressBook"];
|
||||
if (value)
|
||||
{
|
||||
[metadata setObject: value forKey: @"isAddressBook"];
|
||||
isAddressBook = [value boolValue];
|
||||
}
|
||||
else
|
||||
isAddressBook = NO;
|
||||
value = [udSource objectForKey: @"displayName"];
|
||||
if (value)
|
||||
[metadata setObject: value forKey: @"displayName"];
|
||||
if ([_sourcesMetadata objectForKey: sourceID])
|
||||
[self errorWithFormat: @"attempted to register a contact/user source"
|
||||
@" with duplicated id (%@)", sourceID];
|
||||
else
|
||||
{
|
||||
if (isAddressBook)
|
||||
[self errorWithFormat: @"addressbook source '%@' has"
|
||||
@" no displayname", sourceID];
|
||||
type = [[udSource objectForKey: @"type"] lowercaseString];
|
||||
c = NSClassFromString([_registry sourceClassForType: type]);
|
||||
sogoSource = [c sourceFromUDSource: udSource inDomain: domain];
|
||||
if (sourceID)
|
||||
[_sources setObject: sogoSource forKey: sourceID];
|
||||
else
|
||||
[self errorWithFormat: @"id field missing in an user source,"
|
||||
@" check the SOGoUserSources defaults"];
|
||||
metadata = [NSMutableDictionary dictionary];
|
||||
if (domain)
|
||||
[metadata setObject: domain forKey: @"domain"];
|
||||
value = [udSource objectForKey: @"canAuthenticate"];
|
||||
if (value)
|
||||
[metadata setObject: value forKey: @"canAuthenticate"];
|
||||
value = [udSource objectForKey: @"isAddressBook"];
|
||||
if (value)
|
||||
{
|
||||
[metadata setObject: value forKey: @"isAddressBook"];
|
||||
isAddressBook = [value boolValue];
|
||||
}
|
||||
else
|
||||
isAddressBook = NO;
|
||||
value = [udSource objectForKey: @"displayName"];
|
||||
if (value)
|
||||
[metadata setObject: value forKey: @"displayName"];
|
||||
else
|
||||
{
|
||||
if (isAddressBook)
|
||||
[self errorWithFormat: @"addressbook source '%@' has"
|
||||
@" no displayname", sourceID];
|
||||
}
|
||||
value = [udSource objectForKey: @"MailFieldNames"];
|
||||
if (value)
|
||||
[metadata setObject: value forKey: @"MailFieldNames"];
|
||||
value = [udSource objectForKey: @"SearchFieldNames"];
|
||||
if (value)
|
||||
[metadata setObject: value forKey: @"SearchFieldNames"];
|
||||
|
||||
[_sourcesMetadata setObject: metadata forKey: sourceID];
|
||||
}
|
||||
value = [udSource objectForKey: @"MailFieldNames"];
|
||||
if (value)
|
||||
[metadata setObject: value forKey: @"MailFieldNames"];
|
||||
value = [udSource objectForKey: @"SearchFieldNames"];
|
||||
if (value)
|
||||
[metadata setObject: value forKey: @"SearchFieldNames"];
|
||||
[_sourcesMetadata setObject: metadata forKey: sourceID];
|
||||
}
|
||||
else
|
||||
[self errorWithFormat: @"attempted to register a contact/user source"
|
||||
|
||||
Reference in New Issue
Block a user