Merge pull request #203 from inverse-inc/v2

Merge from upstream
This commit is contained in:
Enrique J. Hernández committed 2015-11-23 12:51:52 +01:00
commit f64b324133
267 files changed
+8607 -1717

No files matched your search

+2 -2
View File
@@ -310,7 +310,7 @@ static NSDictionary *BSONTypes()
case 'q': return 0x12;
default:
[NSException raise: NSInvalidArgumentException format: @"%@::%s - invalid encoding type '%c'", [self class], _cmd, encoding];
[NSException raise: NSInvalidArgumentException format: @"%@::%@ - invalid encoding type '%c'", [self class], NSStringFromSelector(_cmd), encoding];
}
return 0;
}
@@ -385,7 +385,7 @@ static NSDictionary *BSONTypes()
}
[NSException raise: NSInvalidArgumentException format: @"%@::%s - invalid encoding type '%c'", [self class], _cmd, encoding];
[NSException raise: NSInvalidArgumentException format: @"%@::%@ - invalid encoding type '%c'", [self class], NSStringFromSelector(_cmd), encoding];
return nil;
}
+1 -1
View File
@@ -1703,7 +1703,7 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
hostname: hostname
port: [NSString stringWithFormat: @"%d", port]
encryption: encryption
bindAsCurrentUser: NO];
bindAsCurrentUser: [NSString stringWithFormat: @"%d", NO]];
[ab setBaseDN: [entry dn]
IDField: @"cn"
CNField: @"displayName"
+6 -6
View File
@@ -88,9 +88,9 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
NSString *str;
str = [NSString stringWithFormat: @"%.4d%.2d%.2d",
[self yearOfCommonEra],
[self monthOfYear],
[self dayOfMonth]];
(int)[self yearOfCommonEra],
(int)[self monthOfYear],
(int)[self dayOfMonth]];
return str;
}
@@ -107,9 +107,9 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
return
[NSString stringWithFormat: @"%@, %.2d %@ %d %.2d:%.2d:%.2d %+.4d",
rfc822Days[[self dayOfWeek]], [self dayOfMonth],
rfc822Months[[self monthOfYear]], [self yearOfCommonEra],
[self hourOfDay], [self minuteOfHour], [self secondOfMinute],
rfc822Days[[self dayOfWeek]], (int)[self dayOfMonth],
rfc822Months[[self monthOfYear]], (int)[self yearOfCommonEra],
(int)[self hourOfDay], (int)[self minuteOfHour], (int)[self secondOfMinute],
timeZoneShift];
}
+1 -1
View File
@@ -23,7 +23,7 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __OpenBSD__
#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <crypt.h>
#endif
+1 -1
View File
@@ -46,7 +46,7 @@
{
NSString *newTag;
newTag = [NSString stringWithFormat: @"n%d", [namespaces count]];
newTag = [NSString stringWithFormat: @"n%d", (int)[namespaces count]];
[namespaces setObject: newTag forKey: newNS];
return newTag;
+1 -1
View File
@@ -309,7 +309,7 @@ static int cssEscapingCount;
c == 0xD ||
(c >= 0x20 && c <= 0xD7FF) ||
(c >= 0xE000 && c <= 0xFFFD) ||
(c >= 0x10000 && c <= 0x10FFFF))
(c >= (unichar)0x10000 && c <= (unichar)0x10FFFF))
{
*(start+j) = c;
j++;
+1
View File
@@ -21,6 +21,7 @@
#ifndef SOGOCACHE_H
#define SOGOCACHE_H
#import <Foundation/Foundation.h>
#import <Foundation/NSObject.h>
#include <libmemcached/memcached.h>
+2
View File
@@ -40,6 +40,8 @@
- (NSMutableString *) pathForChild: (NSString *) childName;
- (void) addUserInAcls: (NSString *) user;
- (NSArray *) toOneRelationshipKeys;
- (NSArray *) toManyRelationshipKeys;
+1 -1
View File
@@ -364,7 +364,7 @@ Class SOGoCacheGCSObjectK = Nil;
if (record)
{
if ([[record objectForKey: @"c_type"] intValue] == MAPIFolderCacheObject)
objectClass = isa;
objectClass = object_getClass(self);
else
objectClass = SOGoCacheGCSObjectK;
+3
View File
@@ -55,6 +55,9 @@ typedef enum {
- (void) reloadIfNeeded;
- (void) save;
- (NSException *) destroy;
+ (id) objectWithName: (NSString *) key inContainer: (id) theContainer useCache: (BOOL) useCache;
/* accessors */
- (NSMutableString *) path; /* full filename */
+17 -8
View File
@@ -87,7 +87,7 @@ static EOAttribute *textColumn = nil;
{
tableUrl = nil;
initialized = NO;
objectType = -1;
objectType = (SOGoCacheObjectType) -1;
deleted = NO;
version = 0;
}
@@ -103,11 +103,22 @@ static EOAttribute *textColumn = nil;
}
+ (id) objectWithName: (NSString *) key inContainer: (id) theContainer
{
return [self objectWithName: key
inContainer: theContainer
useCache: YES];
}
+ (id) objectWithName: (NSString *) key inContainer: (id) theContainer useCache: (BOOL) useCache
{
SOGoCache *cache;
id o;
cache = [SOGoCache sharedCache];
if (!useCache)
[cache unregisterObjectWithName: key inContainer: theContainer];
o = [cache objectNamed: key inContainer: theContainer];
if (!o)
@@ -383,7 +394,7 @@ static EOAttribute *textColumn = nil;
@"SELECT * FROM %@ WHERE c_path = %@",
tableName, pathValue];
if (startVersion > -1)
[sql appendFormat: @" AND c_version > %d", startVersion];
[sql appendFormat: @" AND c_version > %d", (int)startVersion];
/* execution */
records = [self performSQLQuery: sql];
@@ -411,15 +422,13 @@ static EOAttribute *textColumn = nil;
tableName = [self tableName];
adaptor = [self tableChannelAdaptor];
pathValue = [adaptor formatValue: [NSString stringWithFormat: @"/%@", deviceId]
forAttribute: textColumn];
/* query */
sql = [NSMutableString stringWithFormat:
@"SELECT * FROM %@ WHERE c_type = %d AND c_deleted <> 1", tableName, objectType];
if (startVersion > -1)
[sql appendFormat: @" AND c_version > %d", startVersion];
[sql appendFormat: @" AND c_version > %d", (int)startVersion];
if (deviceId) {
pathValue = [adaptor formatValue: [NSString stringWithFormat: @"/%@%", deviceId]
@@ -546,7 +555,7 @@ static EOAttribute *textColumn = nil;
lastModifiedValue = (NSInteger) [lastModified timeIntervalSince1970];
if (objectType == -1)
if (objectType == (SOGoCacheObjectType) -1)
[NSException raise: @"SOGoCacheIOException"
format: @"object type has not been set for object '%@'",
self];
@@ -576,7 +585,7 @@ static EOAttribute *textColumn = nil;
@")"),
tableName,
pathValue, parentPathValue, objectType,
creationDateValue, lastModifiedValue,
(int)creationDateValue, (int)lastModifiedValue,
propsValue];
isNew = NO;
}
@@ -590,7 +599,7 @@ static EOAttribute *textColumn = nil;
@" c_version = %d, c_content = %@"
@" WHERE c_path = %@"),
tableName,
lastModifiedValue, deletedValue, version, propsValue,
(int)lastModifiedValue, (int)deletedValue, (int)version, propsValue,
pathValue];
}
-2
View File
@@ -42,8 +42,6 @@
- (NSCalendarDate *) creationDate;
- (NSCalendarDate *) lastModified;
- (NSException *) destroy;
@end
#endif /* SOGOCACHEOBJECT_H */
+6 -3
View File
@@ -94,7 +94,7 @@
{
[self subclassResponsibility: _cmd];
return nil;
return (Class *) nil;
}
- (void) _setRecord: (NSDictionary *) objectRecord
@@ -254,6 +254,9 @@
- (NSException *) moveToFolder: (SOGoGCSFolder *) newFolder
{
[self subclassResponsibility: _cmd];
// TODO: Add exception handling code and return it
return (NSException *) nil;
}
- (NSException *) delete
@@ -345,7 +348,7 @@
/* attempt a save */
error = [self saveComponent: [[self parsingClass] parseSingleFromSource: [rq contentAsString]]
error = [self saveComponent: [(id)[self parsingClass] parseSingleFromSource: [rq contentAsString]]
baseVersion: baseVersion];
if (error)
response = (WOResponse *) error;
@@ -410,7 +413,7 @@
else
length = 0;
return [NSString stringWithFormat: @"%u", length];
return [NSString stringWithFormat: @"%u", (unsigned int)length];
}
- (NSException *) davMoveToTargetObject: (id) _target
+1 -1
View File
@@ -41,7 +41,7 @@
SOGoLanguage = "English";
SOGoSupportedLanguages = ( "Arabic", "Basque", "Catalan", "ChineseTaiwan", "Czech", "Dutch", "Danish", "Welsh", "English",
"SpanishSpain", "SpanishArgentina", "Finnish", "French", "German",
"Icelandic", "Italian", "Hungarian", "BrazilianPortuguese",
"Icelandic", "Italian", "Macedonian", "Hungarian", "Portuguese", "BrazilianPortuguese",
"NorwegianBokmal", "NorwegianNynorsk", "Polish", "Russian", "Slovak",
"Slovenian", "Ukrainian", "Swedish" );
+1 -1
View File
@@ -107,7 +107,7 @@
- (void) setDisplayName: (NSString *) newDisplayName
{
ASSIGN (displayName, newDisplayName);
ASSIGN (displayName, (NSMutableString *)newDisplayName);
}
- (NSString *) displayName
+4 -4
View File
@@ -399,12 +399,12 @@ static NSArray *childRecordFields = nil;
if (!displayName)
{
if (activeUserIsOwner)
displayName = [self _displayNameFromOwner];
displayName = (NSMutableString *)[self _displayNameFromOwner];
else
{
displayName = [self _displayNameFromSubscriber];
displayName = (NSMutableString *)[self _displayNameFromSubscriber];
if (!displayName)
displayName = [self _displayNameFromOwner];
displayName = (NSMutableString *)[self _displayNameFromOwner];
}
[displayName retain];
}
@@ -852,7 +852,7 @@ static NSArray *childRecordFields = nil;
{
currentID = [ids objectAtIndex: count];
names = [[currentID componentsSeparatedByString: @"/"] objectEnumerator];
deleteObject = self;
deleteObject = (SOGoContentObject *)self;
while ((currentName = [names nextObject]))
{
deleteObject = [deleteObject lookupName: currentName
+2 -2
View File
@@ -135,7 +135,7 @@
{
NSArray *allSources;
NGLdapEntry *entry;
NSObject <SOGoSource> *source;
NSObject <SOGoSource, SOGoDNSource> *source;
id o;
NSEnumerator *gclasses;
NSString *gclass;
@@ -154,7 +154,7 @@
for (i = 0; i < [allSources count]; i++)
{
source = [[SOGoUserManager sharedUserManager] sourceWithID: [allSources objectAtIndex: i]];
source = (NSObject <SOGoSource, SOGoDNSource> *) [[SOGoUserManager sharedUserManager] sourceWithID: [allSources objectAtIndex: i]];
// Our different sources might not all implements groups support
if ([source respondsToSelector: theSelector])
+3 -3
View File
@@ -1069,7 +1069,7 @@
[_ms appendFormat:@" name=%@", nameInContainer];
if (container)
[_ms appendFormat:@" container=0x%08X/%@",
container, [container valueForKey:@"nameInContainer"]];
(unsigned int)container, [container valueForKey:@"nameInContainer"]];
}
- (NSString *) description
@@ -1077,7 +1077,7 @@
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
[ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
[ms appendFormat:@"<0x%08X[%@]:", (unsigned int) self, NSStringFromClass([self class])];
[self appendAttributesToDescription:ms];
[ms appendString:@">"];
@@ -1087,7 +1087,7 @@
- (NSString *) loggingPrefix
{
return [NSString stringWithFormat:@"<0x%08X[%@]:%@>",
self, NSStringFromClass([self class]),
(unsigned int) self, NSStringFromClass([self class]),
[self nameInContainer]];
}
+1 -1
View File
@@ -433,7 +433,7 @@ static SoSecurityManager *sm = nil;
error = [self appendPersonalSources];
if (!error)
if ([self respondsToSelector:@selector(appendCollectedSources)])
error = [self appendCollectedSources];
error = [self performSelector:@selector(appendCollectedSources)];
if (!error)
error = [self appendSystemSources]; // TODO : Not really a testcase, see function
if (error)
+6 -6
View File
@@ -880,7 +880,7 @@
reason = [NSString stringWithFormat: @"method '%@' is not available"
@" for class '%@'", NSStringFromSelector (_cmd),
NSStringFromClass (isa)];
NSStringFromClass (object_getClass(self))];
return [NSException exceptionWithName: @"SQLSourceIOException"
reason: reason
@@ -893,7 +893,7 @@
reason = [NSString stringWithFormat: @"method '%@' is not available"
@" for class '%@'", NSStringFromSelector (_cmd),
NSStringFromClass (isa)];
NSStringFromClass (object_getClass(self))];
return [NSException exceptionWithName: @"SQLSourceIOException"
reason: reason
@@ -906,7 +906,7 @@
reason = [NSString stringWithFormat: @"method '%@' is not available"
@" for class '%@'", NSStringFromSelector (_cmd),
NSStringFromClass (isa)];
NSStringFromClass (object_getClass(self))];
return [NSException exceptionWithName: @"SQLSourceIOException"
reason: reason
@@ -932,7 +932,7 @@
reason = [NSString stringWithFormat: @"method '%@' is not available"
@" for class '%@'", NSStringFromSelector (_cmd),
NSStringFromClass (isa)];
NSStringFromClass (object_getClass(self))];
return [NSException exceptionWithName: @"SQLSourceIOException"
reason: reason
@@ -947,7 +947,7 @@
reason = [NSString stringWithFormat: @"method '%@' is not available"
@" for class '%@'", NSStringFromSelector (_cmd),
NSStringFromClass (isa)];
NSStringFromClass (object_getClass(self))];
return [NSException exceptionWithName: @"SQLSourceIOException"
reason: reason
@@ -961,7 +961,7 @@
reason = [NSString stringWithFormat: @"method '%@' is not available"
@" for class '%@'", NSStringFromSelector (_cmd),
NSStringFromClass (isa)];
NSStringFromClass (object_getClass(self))];
return [NSException exceptionWithName: @"SQLSourceIOException"
reason: reason
+15 -8
View File
@@ -180,14 +180,21 @@
cc = [self clientCapabilities];
b = (
[[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound
&& [[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound
|| (
[[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound
|| [[cc userAgent] rangeOfString: @"Mac OS X"].location != NSNotFound
)
&& [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound
);
(
[[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound
&& [[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound
)
||
(
[[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound
&& [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound
)
||
(
[[cc userAgent] rangeOfString: @"Mac OS X"].location != NSNotFound
&& [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound
)
);
return b;
}