mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-18 03:38:49 +00:00
Monotone-Parent: c35e5e0bbfa47c91a6b8c9b68bf31ca78ee421fc
Monotone-Revision: 0866c0c584ab301776f7eea26a8ec8135a9c106c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-12-14T20:54:07 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
2010-12-14 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/EOQualifier+MAPIFS.m (-[EOBitmaskQualifier
|
||||
_evaluateMAPIFSMessageProperties:]): new method adapted to the new
|
||||
class below.
|
||||
|
||||
* OpenChange/EOBitmaskQualifier.[hm]: new class module
|
||||
implementing a new EOQualifier subclass that's adapted to the MAPI
|
||||
bitmask restrictions.
|
||||
|
||||
2010-12-14 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
|
||||
* Implemented the "bindAsCurrentUser" feature (when
|
||||
|
||||
45
OpenChange/EOBitmaskQualifier.h
Normal file
45
OpenChange/EOBitmaskQualifier.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* EOBitmaskQualifier.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010 Inverse inc
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef EOBITMASKQUALIFIER_H
|
||||
#define EOBITMASKQUALIFIER_H
|
||||
|
||||
#import <EOControl/EOQualifier.h>
|
||||
|
||||
@interface EOBitmaskQualifier : EOQualifier
|
||||
{
|
||||
NSString *key;
|
||||
uint32_t mask;
|
||||
BOOL isZero;
|
||||
}
|
||||
|
||||
- (id) initWithKey: (NSString *) newKey
|
||||
mask: (uint32_t) newMask
|
||||
isZero: (BOOL) newIsZero;
|
||||
|
||||
- (NSString *) key;
|
||||
- (uint32_t ) mask;
|
||||
- (BOOL) isZero;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* EOBITMASKQUALIFIER_H */
|
||||
62
OpenChange/EOBitmaskQualifier.m
Normal file
62
OpenChange/EOBitmaskQualifier.m
Normal file
@@ -0,0 +1,62 @@
|
||||
/* EOBitmaskQualifier.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010 Inverse inc
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "EOBitmaskQualifier.h"
|
||||
|
||||
@implementation EOBitmaskQualifier
|
||||
|
||||
- (id) initWithKey: (NSString *) newKey
|
||||
mask: (uint32_t) newMask
|
||||
isZero: (BOOL) newIsZero
|
||||
{
|
||||
if ((self = [self init]))
|
||||
{
|
||||
ASSIGN (key, newKey);
|
||||
isZero = newIsZero;
|
||||
mask = newMask;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[key release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *) key
|
||||
{
|
||||
return key;
|
||||
}
|
||||
|
||||
- (uint32_t ) mask
|
||||
{
|
||||
return mask;
|
||||
}
|
||||
|
||||
- (BOOL) isZero
|
||||
{
|
||||
return isZero;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -29,6 +29,7 @@
|
||||
#import "SOGoMAPIFSMessage.h"
|
||||
|
||||
#import "EOQualifier+MAPIFS.h"
|
||||
#import "EOBitmaskQualifier.h"
|
||||
|
||||
@implementation EOQualifier (MAPIStoreRestrictions)
|
||||
|
||||
@@ -110,3 +111,27 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation EOBitmaskQualifier (MAPIStoreRestrictionsPrivate)
|
||||
|
||||
- (BOOL) _evaluateMAPIFSMessageProperties: (NSDictionary *) properties
|
||||
{
|
||||
NSNumber *propTag;
|
||||
id propValue;
|
||||
uint32_t intValue;
|
||||
BOOL rc;
|
||||
|
||||
propTag = [NSNumber numberWithInt: [key intValue]];
|
||||
propValue = [properties objectForKey: propTag];
|
||||
intValue = [propValue unsignedIntValue];
|
||||
|
||||
rc = ((isZero && (intValue & mask) == 0)
|
||||
|| (!isZero && (intValue & mask) != 0));
|
||||
|
||||
[self logWithFormat: @"evaluating bitmask qualifier: (%.8x & %.8x) %s 0: %d",
|
||||
intValue, mask, (isZero ? "==" : "!="), rc];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user