From 1844d390df2ddd23b645433f71810f9a2a6e3063 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 4 Jul 2007 20:07:52 +0000 Subject: [PATCH] Monotone-Parent: 8a8f01d00132a79870b7c9ed8adbce9f4c0c79bb Monotone-Revision: 23e776c8c54fe02739326119a5d6519e81abc605 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-07-04T20:07:52 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ Main/SOGo.m | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 85d34b253..deffdb041 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-07-04 Wolfgang Sourdeau + * Main/SOGo.m ([SOGo -lookupUser:_keyinContext:]): check if the + user exists before creating the SOGoUserFolder instance. If not, + returns nil. + * UI/MailerUI/UIxMailSourceView.[hm]: new class module designed to return the message source code in plain text. diff --git a/Main/SOGo.m b/Main/SOGo.m index efe2accf1..0ee12f43c 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -43,6 +43,7 @@ #import #import +#import #import #import "SOGoProductLoader.h" @@ -241,9 +242,20 @@ static BOOL debugObjectAllocation = NO; return YES; } -- (id)lookupUser:(NSString *)_key inContext:(id)_ctx { - return [$(@"SOGoUserFolder") objectWithName:_key - inContainer: self]; +- (id) lookupUser: (NSString *) _key + inContext: (id)_ctx +{ + SOGoUser *user; + id userFolder; + + user = [SOGoUser userWithLogin: _key roles: nil]; + if (user) + userFolder = [$(@"SOGoUserFolder") objectWithName: _key + inContainer: self]; + else + userFolder = nil; + + return userFolder; } - (void) _setupLocaleInContext: (WOContext *) _ctx @@ -289,7 +301,7 @@ static BOOL debugObjectAllocation = NO; if ([self isUserName:_key inContext:_ctx]) return [self lookupUser:_key inContext:_ctx]; - + return nil; }