From e87a11440557ca3c88ebb29f7168032b2010d6cf Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 13 Jun 2008 20:08:45 +0000 Subject: [PATCH] Monotone-Parent: dd0f98cf89d78f378ec83484a40047514086bc36 Monotone-Revision: 846898c32d1bedf090b028559140bf62812511c5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-06-13T20:08:45 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoObject.h | 1 + SoObjects/SOGo/SOGoObject.m | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0f6629798..430420ead 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-06-13 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoObject.m ([SOGoObject + -ownerInContext:localContext]): set a new ivar: activeUserIsOwner + to reduce method calls. + * Main/SOGo.m ([SOGo -dispatchRequest:_request]): we now report the time taken by the request, if the "SOGoDebugRequests" user default is set. diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index d800d74c3..c6285d0a2 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -68,6 +68,7 @@ NSString *owner; SOGoWebDAVAclManager *webdavAclManager; id container; + BOOL activeUserIsOwner; } + (NSString *) globallyUniqueObjectId; diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index fccb4e359..b3314e80f 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -200,6 +200,7 @@ static NSDictionary *reportMap = nil; container = nil; owner = nil; webdavAclManager = [[self class] webdavAclManager]; + activeUserIsOwner = NO; } return self; @@ -255,8 +256,14 @@ static NSDictionary *reportMap = nil; - (NSString *) ownerInContext: (id) localContext { + NSString *uid; + if (!owner) - owner = [container ownerInContext: context]; + { + owner = [container ownerInContext: context]; + uid = [[localContext activeUser] login]; + activeUserIsOwner = [owner isEqualToString: uid]; + } return owner; }