Monotone-Parent: a6f65fa9361ca6a3fc6870978fa9814e3c65652e

Monotone-Revision: 4198b7cec911933d302e467416f80df87577acdb

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-07-22T20:32:16
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-07-22 20:32:16 +00:00
parent eccfa3c55c
commit bf8245a4be
3 changed files with 35 additions and 0 deletions

View File

@@ -1,5 +1,10 @@
2007-07-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/NSString+Utilities.m ([NSString
-asDavInvocation]): new method returning a dictionary with a "ns"
key representing the dav namespace and a "method" key representing
the dav method name of the request.
* UI/PreferencesUI/UIxPreferences.m ([UIxPreferences
+initialize]): scan the value of SOGoUIxUserCanChangePassword.
Default is "no".

View File

@@ -37,6 +37,7 @@
- (NSString *) urlWithoutParameters;
- (NSString *) davMethodToObjC;
- (NSDictionary *) asDavInvocation;
- (NSString *) stringByDetectingURLs;

View File

@@ -108,6 +108,35 @@ static NSMutableCharacterSet *urlAfterEndingChars = nil;
return newName;
}
- (NSDictionary *) asDavInvocation
{
NSMutableDictionary *davInvocation;
NSRange nsEnclosing, methodEnclosing;
unsigned int length;
davInvocation = nil;
if ([self hasPrefix: @"{"])
{
nsEnclosing = [self rangeOfString: @"}"];
length = [self length];
if (nsEnclosing.length > 0
&& nsEnclosing.location < (length - 1))
{
methodEnclosing = NSMakeRange(nsEnclosing.location + 1,
length - nsEnclosing.location - 1);
nsEnclosing.length = nsEnclosing.location - 1;
nsEnclosing.location = 1;
davInvocation = [NSMutableDictionary dictionaryWithCapacity: 2];
[davInvocation setObject: [self substringWithRange: nsEnclosing]
forKey: @"ns"];
[davInvocation setObject: [self substringWithRange: methodEnclosing]
forKey: @"method"];
}
}
return davInvocation;
}
- (NSRange) _rangeOfURLInRange: (NSRange) refRange
{
int start, length;