From 5a3fdefbb4d4af6dff07d83153b21168a6af0bd5 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 15 Aug 2007 20:10:42 +0000 Subject: [PATCH] Monotone-Parent: 5a752c9870d0f15bdeafe1c5657bcad3f21ef35a Monotone-Revision: 1be5732f06e2d40958dabf3dc0142cabc8ac4a21 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-15T20:10:42 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 + SoObjects/Mailer/SOGoUser+Mail.h | 48 ---------- SoObjects/Mailer/SOGoUser+Mail.m | 146 ------------------------------- 3 files changed, 3 insertions(+), 194 deletions(-) delete mode 100644 SoObjects/Mailer/SOGoUser+Mail.h delete mode 100644 SoObjects/Mailer/SOGoUser+Mail.m diff --git a/ChangeLog b/ChangeLog index 457a6b557..453deadae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-08-15 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoUser+Mail.[hm]: removed useless class + extension module. + * SoObjects/Mailer/SOGoMailIdentity.[hm]: removed useless class module. diff --git a/SoObjects/Mailer/SOGoUser+Mail.h b/SoObjects/Mailer/SOGoUser+Mail.h deleted file mode 100644 index 432de0f1d..000000000 --- a/SoObjects/Mailer/SOGoUser+Mail.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2005 SKYRIX Software AG - - This file is part of OpenGroupware.org. - - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. -*/ - -#ifndef __Mailer_SOGoUser_Mail_H__ -#define __Mailer_SOGoUser_Mail_H__ - -#include - -/* - SOGoUser(Mail) - - TODO: document - - This category adds mail related stuff to the SOGo user class. -*/ - -#include - -@class NSArray; -@class SOGoMailIdentity; - -@interface SOGoUser(Mail) - -- (SOGoMailIdentity *)primaryMailIdentity; -- (NSArray *)fetchAllMailIdentitiesWithOnlyEmitterAccess:(BOOL)_onlyGC; -- (SOGoMailIdentity *)primaryMailIdentityForAccount:(NSString *)_account; - -@end - -#endif /* __Mailer_SOGoUser_Mail_H__ */ diff --git a/SoObjects/Mailer/SOGoUser+Mail.m b/SoObjects/Mailer/SOGoUser+Mail.m deleted file mode 100644 index 2cde83986..000000000 --- a/SoObjects/Mailer/SOGoUser+Mail.m +++ /dev/null @@ -1,146 +0,0 @@ -/* - Copyright (C) 2004-2005 SKYRIX Software AG - - This file is part of OpenGroupware.org. - - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. -*/ - -#import -#import -#import - -#import -#import - -#import "SOGoMailIdentity.h" - -#import "SOGoUser+Mail.h" - -@implementation SOGoUser(Mail) - -- (NSString *)agenorSentFolderName { - /* Note: specialty: the Sent folder is called the same in all accounts */ - static NSString *s = nil; - if (s == nil) { - NSUserDefaults *ud; - - ud = [NSUserDefaults standardUserDefaults]; - s = [[ud stringForKey:@"SOGoSentFolderName"] copy]; - if (![s isNotEmpty]) s = @"Sent"; - [self logWithFormat:@"Note: using SOGoSentFolderName: '%@'", s]; - } - return s; -} - -- (NSString *)agenorSentFolderForAccount:(NSString *)_account { - // TODO: support different locations for shares! - NSString *p; - - if (![_account isNotEmpty]) - return nil; - - // if ([_account rangeOfString:@".-."].length == 0) - // TODO: check whether we need special handling for shares! - p = [_account stringByAppendingString:@"/"]; - p = [p stringByAppendingString:[self agenorSentFolderName]]; - return p; -} - -- (SOGoMailIdentity *)primaryMailIdentity { - SOGoMailIdentity *identity; - NSString *account; - - account = [self valueForKey:@"primaryIMAP4AccountString"]; - - identity = [[[SOGoMailIdentity alloc] init] autorelease]; - [identity setName: [self cn]]; - [identity setEmail: [self primaryEmail]]; - [identity setSentFolderName:[self agenorSentFolderForAccount:account]]; - return identity; -} - -- (SOGoMailIdentity *)mailIdentityForAccount:(NSString *)_account - emitter:(NSString *)_em -{ - SOGoMailIdentity *identity; - - identity = [[[SOGoMailIdentity alloc] init] autorelease]; - [identity setName:[self cn]]; // TODO: should we use something else? - if ([_em isNotEmpty]) [identity setEmail:_em]; - [identity setSentFolderName:[self agenorSentFolderForAccount:_account]]; - return identity; -} - -- (NSArray *)fetchAllMailIdentitiesWithOnlyEmitterAccess:(BOOL)_onlyGC { - NSMutableArray *identities; - NSEnumerator *accounts; - NSDictionary *shares; - NSString *account; - id identity; - - identity = [self primaryMailIdentity]; - shares = [self valueForKey:@"additionalIMAP4AccountsAndEMails"]; - if ([shares count] == 0) - return [NSArray arrayWithObject: identity]; - - identities = [NSMutableArray arrayWithCapacity:[shares count] + 1]; - if (identity != nil) [identities addObject:identity]; - - accounts = [shares keyEnumerator]; - while ((account = [accounts nextObject]) != nil) { - NSString *emitter; - - emitter = [shares objectForKey:account]; - if (_onlyGC && ![emitter isNotNull]) continue; - - identity = [self mailIdentityForAccount:account emitter:emitter]; - if (identity != nil) - [identities addObject:identity]; - } - - return identities; -} - -- (SOGoMailIdentity *)primaryMailIdentityForAccount:(NSString *)_account { - NSEnumerator *accounts; - NSDictionary *shares; - NSString *account; - id identity; - - identity = [self primaryMailIdentity]; - shares = [self valueForKey:@"additionalIMAP4AccountsAndEMails"]; - if ([shares count] == 0) - return identity; - - /* scan shares for ID */ - accounts = [shares keyEnumerator]; - while ((account = [accounts nextObject]) != nil) { - NSString *emitter; - - if (![account isEqualToString:_account]) - continue; - - emitter = [shares objectForKey:account]; - identity = [self mailIdentityForAccount:_account emitter:emitter]; - if ([identity isNotNull]) - return identity; - } - - return identity; -} - -@end /* SOGoUser(Mail) */