From: znek Date: Tue, 19 Jul 2005 16:55:19 +0000 (+0000) Subject: Fixed SOGo Bug #1050. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0af4cf502839239674550a4c1a066576d162f774;p=scalable-opengroupware.org Fixed SOGo Bug #1050. git-svn-id: http://svn.opengroupware.org/SOGo/trunk@832 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SoObjects/SOGo/AgenorUserManager.m b/SOGo/SoObjects/SOGo/AgenorUserManager.m index ff049f58..fa7d3c7d 100644 --- a/SOGo/SoObjects/SOGo/AgenorUserManager.m +++ b/SOGo/SoObjects/SOGo/AgenorUserManager.m @@ -42,7 +42,9 @@ - (BOOL)primaryIsInternetAutoresponderEnabledForUser:(NSString *)_uid; - (BOOL)primaryIsIntranetAutoresponderEnabledForUser:(NSString *)_uid; -- (id)primaryGetMailAutoresponderAttribute:(NSString *)_uid; +- (NGLdapAttribute *)primaryGetMailAutoresponderAttribute:(NSString *)_uid; +- (BOOL)isAutoresponderEnabledForAttribute:(NGLdapAttribute *)_attr + matchingPrefix:(NSString *)_prefix; @end // TODO: add a timer to flush LRU caches every some hours @@ -929,7 +931,11 @@ static NSArray *fromEMailAttrs = nil; } - (BOOL)primaryIsInternetAutoresponderEnabledForUser:(NSString *)_uid { - return NO; + NGLdapAttribute *attr; + + attr = [self primaryGetMailAutoresponderAttribute:_uid]; + if (!attr) return NO; + return [self isAutoresponderEnabledForAttribute:attr matchingPrefix:@"60~"]; } - (BOOL)isIntranetAutoresponderEnabledForUser:(NSString *)_uid { @@ -947,10 +953,33 @@ static NSArray *fromEMailAttrs = nil; } - (BOOL)primaryIsIntranetAutoresponderEnabledForUser:(NSString *)_uid { + NGLdapAttribute *attr; + + attr = [self primaryGetMailAutoresponderAttribute:_uid]; + if (!attr) return NO; + return [self isAutoresponderEnabledForAttribute:attr matchingPrefix:@"50~"]; +} + +- (BOOL)isAutoresponderEnabledForAttribute:(NGLdapAttribute *)_attr + matchingPrefix:(NSString *)_prefix +{ + unsigned i, count; + + count = [_attr count]; + for (i = 0; i < count; i++) { + NSString *value; + + value = [_attr stringValueAtIndex:i]; + if ([value hasPrefix:_prefix]) { + if ([value rangeOfString:@"DFIN:0"].length > 0) + return NO; + return YES; + } + } return NO; } -- (id)primaryGetMailAutoresponderAttribute:(NSString *)_uid { +- (NGLdapAttribute *)primaryGetMailAutoresponderAttribute:(NSString *)_uid { static NSArray *attrs = nil; NGLdapConnection *conn; EOQualifier *q; @@ -977,14 +1006,7 @@ static NSArray *fromEMailAttrs = nil; return nil; } attr = [entry attributeWithName:mailAutoresponderAttrName]; - if(attr == nil) { - return nil; /* nothing we can do about it */ - } - /* ZNeK: TODO - * ... we need to have the proper specs before we can do anything about it - */ - [self warnWithFormat:@"%s TODO", __PRETTY_FUNCTION__]; - return nil; + return attr; } /* debugging */ diff --git a/SOGo/SoObjects/SOGo/ChangeLog b/SOGo/SoObjects/SOGo/ChangeLog index cdb10a19..abb58241 100644 --- a/SOGo/SoObjects/SOGo/ChangeLog +++ b/SOGo/SoObjects/SOGo/ChangeLog @@ -1,3 +1,8 @@ +2005-07-19 Marcus Mueller + + * AgenorUserManager.m: properly implemented internet/intranet vacation + message status detection (v0.9.64) + 2005-07-14 Marcus Mueller * v0.9.63 diff --git a/SOGo/SoObjects/SOGo/Version b/SOGo/SoObjects/SOGo/Version index d937b347..cf0769b0 100644 --- a/SOGo/SoObjects/SOGo/Version +++ b/SOGo/SoObjects/SOGo/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=63 +SUBMINOR_VERSION:=64 # v0.9.63 requires libNGiCal v4.5.54 # v0.9.60 requires libNGiCal v4.5.49