@implementation UIxMailEditor
-static BOOL keepMailTmpFile = NO;
-static BOOL showInternetMarker = NO;
-static EOQualifier *internetDetectQualifier = nil;
-static NSDictionary *internetMailHeaders = nil;
-static NSArray *infoKeys = nil;
+static BOOL keepMailTmpFile = NO;
+static BOOL showInternetMarker = NO;
+static NSDictionary *internetMailHeaders = nil;
+static NSArray *infoKeys = nil;
+ (void)initialize {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
- NSString *s;
infoKeys = [[NSArray alloc] initWithObjects:
@"subject", @"text", @"to", @"cc", @"bcc",
@"(SOGoShowInternetMarker)");
}
- if ((s = [ud stringForKey:@"SOGoInternetDetectQualifier"]) != nil) {
- internetDetectQualifier =
- [[EOQualifier qualifierWithQualifierFormat:s] retain];
- if (internetDetectQualifier == nil)
- NSLog(@"UIxMailEditor: could not parse qualifier: '%@'", s);
- }
- if (internetDetectQualifier == nil)
- NSLog(@"UIxMailEditor: no 'SOGoInternetDetectQualifier' configured.");
- else {
- NSLog(@"UIxMailEditor: detect Internet access using: %@",
- internetDetectQualifier);
- }
-
internetMailHeaders =
[[ud dictionaryForKey:@"SOGoInternetMailHeaders"] copy];
NSLog(@"Note: specified %d headers for mails send via the Internet.",
/* detect webmail being accessed from the outside */
- (BOOL)isInternetRequest {
+ // DEPRECATED
return [[self context] isAccessFromIntranet] ? NO : YES;
}
- (BOOL)showInternetMarker {
if (!showInternetMarker)
return NO;
- return [self isInternetRequest];
+ return [[self context] isAccessFromIntranet] ? NO : YES;
}
/* info loading */
/* setup some extra headers if required */
- h = [self isInternetRequest] ? internetMailHeaders : nil;
+ h = [[self context] isAccessFromIntranet] ? nil : internetMailHeaders;
/* save mail to file (so that we can upload the mail to Cyrus) */
// TODO: all this could be handled by the SOGoDraftObject?