From 13721b961b2224b3918b421c13816d045c86e322 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Fri, 10 Jan 2014 14:03:50 -0500 Subject: [PATCH] Add an easy way to get the personal contact folder, just like we have for calendars --- SoObjects/SOGo/SOGoUser.h | 2 ++ SoObjects/SOGo/SOGoUser.m | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/SoObjects/SOGo/SOGoUser.h b/SoObjects/SOGo/SOGoUser.h index e1737cd2f..fad66e4e8 100644 --- a/SoObjects/SOGo/SOGoUser.h +++ b/SoObjects/SOGo/SOGoUser.h @@ -45,6 +45,7 @@ @class SOGoAppointmentFolder; @class SOGoAppointmentFolders; +@class SOGoContactFolder; @class SOGoDateFormatter; @class SOGoDomainDefaults; @class SOGoUserDefaults; @@ -130,6 +131,7 @@ - (SOGoUserFolder *) homeFolderInContext: (id) context; - (SOGoAppointmentFolders *) calendarsFolderInContext: (WOContext *) context; - (SOGoAppointmentFolder *) personalCalendarFolderInContext: (WOContext *) context; +- (SOGoContactFolder *) personalContactsFolderInContext: (WOContext *) context; @end diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index c46331d78..8f2768571 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -841,13 +841,25 @@ acquire: NO]; } -- (SOGoAppointmentFolder *) - personalCalendarFolderInContext: (WOContext *) context +- (SOGoAppointmentFolder *) personalCalendarFolderInContext: (WOContext *) context { return [[self calendarsFolderInContext: context] lookupPersonalFolder: @"personal" ignoringRights: YES]; } +- (SOGoContactFolder *) personalContactsFolderInContext: (WOContext *) context +{ + SOGoContactFolders *folders; + + folders = [[self homeFolderInContext: context] lookupName: @"Contacts" + inContext: context + acquire: NO]; + + return [folders lookupPersonalFolder: @"personal" + ignoringRights: YES]; +} + + - (NSArray *) rolesForObject: (NSObject *) object inContext: (WOContext *) context {