mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-05 20:10:33 +00:00
Monotone-Parent: 29948ba19f24f47aa6c1b2c0764586b89ff9493f
Monotone-Revision: 1a5434f30282a4932bf29227da4cf2da44ef5783 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-07-11T22:28:12 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGCards/iCalCalendar.h>
|
||||
#import <NGCards/iCalPerson.h>
|
||||
@@ -36,6 +37,16 @@
|
||||
|
||||
@implementation iCalEntityObject (SOGoExtensions)
|
||||
|
||||
+ (void) initializeSOGoExtensions;
|
||||
{
|
||||
if (!iCalDistantFuture)
|
||||
{
|
||||
iCalDistantFuture = [[NSCalendarDate distantFuture] retain];
|
||||
/* INT_MAX due to Postgres constraint */
|
||||
iCalDistantFutureNumber = [[NSNumber numberWithUnsignedInt: INT_MAX] retain];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) userIsParticipant: (SOGoUser *) user
|
||||
{
|
||||
NSEnumerator *participants;
|
||||
@@ -128,4 +139,38 @@
|
||||
return newAttendees;
|
||||
}
|
||||
|
||||
- (NSNumber *) quickRecordDateAsNumber: (NSCalendarDate *) _date
|
||||
{
|
||||
return ((_date == iCalDistantFuture)
|
||||
? iCalDistantFutureNumber
|
||||
: [NSNumber numberWithUnsignedInt: [_date timeIntervalSince1970]]);
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *) quickRecord
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (int) priorityNumber
|
||||
{
|
||||
NSString *prio;
|
||||
NSRange r;
|
||||
int priorityNumber;
|
||||
|
||||
prio = [self priority];
|
||||
if (prio)
|
||||
{
|
||||
r = [prio rangeOfString: @";"];
|
||||
if (r.length)
|
||||
prio = [prio substringToIndex:r.location];
|
||||
priorityNumber = [prio intValue];
|
||||
}
|
||||
else
|
||||
priorityNumber = 0;
|
||||
|
||||
return priorityNumber;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user