2005-07-21 Marcus Mueller <znek@mulle-kybernetik.com>
+ * v0.9.145
+
+ * UIxAppointmentView.m: fixed -isMyApt and -canAccessApt to do the
+ proper things
+
* v0.9.144
* UIxCalInlineAptView.m: reworked the way styles are produced now.
/* access */
- (BOOL)isMyApt {
+ NSString *email;
iCalPerson *organizer;
-
+
+ email = [[[self context] activeUser] email];
organizer = [[self appointment] organizer];
if (!organizer) return YES; // assume this is correct to do, right?
- return [[organizer rfc822Email] isEqualToString:[self emailForUser]];
+ return [[organizer rfc822Email] isEqualToString:email];
}
- (BOOL)canAccessApt {
+ NSString *email;
+ NSArray *partMails;
+
if ([self isMyApt])
return YES;
/* not my apt - can access if it's public */
- return [[self appointment] isPublic];
+ if ([[self appointment] isPublic])
+ return YES;
+
+ /* can access it if I'm invited :-) */
+ email = [[[self context] activeUser] email];
+ partMails = [[[self appointment] participants] valueForKey:@"rfc822Email"];
+ return [partMails containsObject:email];
}
- (BOOL)canEditApt {