Skip to content

Commit

Permalink
Revert "(fix) properly honor "include in freebusy" (fixes #3354)"
Browse files Browse the repository at this point in the history
This reverts commit 42c2c66.
  • Loading branch information
extrafu committed Jan 30, 2017
1 parent 6cff413 commit 9a1f91e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions SoObjects/Appointments/SOGoAppointmentFolder.m
Expand Up @@ -437,32 +437,26 @@ - (void) setShowCalendarTasks: (BOOL) new
//
// If the user is the owner of the calendar, by default we include the freebusy information.
//
// If the user is NOT the owner of the calendar but is subscribed, by default we exclude the freebusy information.
// If the user is NOT the owner of the calendar, by default we exclude the freebusy information.
//
// We must include the freebusy information of other users if we are actually looking at their freebusy information
// but we aren't necessarily subscribed to their calendars.
//
- (BOOL) includeInFreeBusy
{
NSString *userLogin, *subscriptionReference;
NSNumber *excludeFromFreeBusy;
NSString *userLogin;
BOOL is_owner;

BOOL is_owner, is_subscription;

userLogin = [[context activeUser] login];
is_owner = [userLogin isEqualToString: self->owner];

// We check if we're subscribed. We must NOT use here [self isSubscribed] as it'll look
// at the owner's settings, and not the activeUser's settings.
subscriptionReference = [NSString stringWithFormat: @"%@:Calendar/%@", self->owner, [self nameInContainer]];
is_subscription = [[[[[self->context activeUser] userSettings] objectForKey: @"Calendar"] objectForKey: @"SubscribedFolders"] containsObject: subscriptionReference];

// Check if the owner (not the active user) has excluded the calendar from her/his free busy data.
excludeFromFreeBusy
= [self folderPropertyValueInCategory: @"FreeBusyExclusions"
forUser: [context activeUser]];

if (is_subscription)
if ([self isSubscription])
{
// If the user has not yet set an include/not include fb information let's EXCLUDE it.
if (!excludeFromFreeBusy)
Expand Down

0 comments on commit 9a1f91e

Please sign in to comment.