See ChangeLog

Monotone-Parent: 2b83c62317d266d5f7a2e2046fc19f68f88a385f
Monotone-Revision: 763ab7e667a159d6b727544a067a085d622ab598

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-06-25T19:58:30
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2010-06-25 19:58:30 +00:00
parent 339a9b60c5
commit b2fc189b93
12 changed files with 501 additions and 205 deletions
+3
View File
@@ -56,6 +56,7 @@
NSString *text;
NSString *sourceURL;
NSString *sourceFlag;
NSString *sourceFolder;
}
/* contents */
@@ -75,6 +76,8 @@
/* for replies and forwards */
- (void) setSourceURL: (NSString *) newSurceURL;
- (void) setSourceFlag: (NSString *) newSourceFlag;
- (void) setSourceFolder: (NSString *) newSourceFolder;
- (NSString *) sourceFolder;
- (void) setIMAP4ID: (int) newIMAPID;
- (int) IMAP4ID;
+44 -5
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 2007-2009 Inverse inc.
Copyright (C) 2007-2010 Inverse inc.
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of SOGo.
@@ -259,6 +259,35 @@ static NSString *userAgent = nil;
ASSIGN (sourceFlag, newSourceFlag);
}
- (void) setSourceFolder: (NSString *) newSourceFolder
{
ASSIGN (sourceFolder, newSourceFolder);
}
- (void) setSourceFolderWithMailObject: (SOGoMailObject *) sourceMail
{
NSMutableArray *paths;
id parent;
parent = [sourceMail container];
paths = [NSMutableArray arrayWithCapacity: 1];
while (parent && ![parent isKindOfClass: [SOGoMailAccount class]])
{
[paths insertObject: [parent nameInContainer] atIndex: 0];
parent = [parent container];
}
if (parent)
[paths insertObject: [NSString stringWithFormat: @"/%@", [parent nameInContainer]]
atIndex: 0];
[self setSourceFolder: [paths componentsJoinedByString: @"/"]];
}
- (NSString *) sourceFolder
{
return sourceFolder;
}
- (NSException *) storeInfo
{
NSMutableDictionary *infos;
@@ -273,12 +302,13 @@ static NSString *userAgent = nil;
if (inReplyTo)
[infos setObject: inReplyTo forKey: @"inReplyTo"];
if (IMAP4ID > -1)
[infos setObject: [NSNumber numberWithInt: IMAP4ID]
forKey: @"IMAP4ID"];
if (sourceURL && sourceFlag)
[infos setObject: [NSString stringWithFormat: @"%i", IMAP4ID]
forKey: @"IMAP4ID"];
if (sourceURL && sourceFlag && sourceFolder)
{
[infos setObject: sourceURL forKey: @"sourceURL"];
[infos setObject: sourceFlag forKey: @"sourceFlag"];
[infos setObject: sourceFolder forKey: @"sourceFolder"];
}
if ([infos writeToFile: [self infoPath] atomically:YES])
@@ -324,6 +354,9 @@ static NSString *userAgent = nil;
value = [infoDict objectForKey: @"sourceFlag"];
if (value)
[self setSourceFlag: value];
value = [infoDict objectForKey: @"sourceFolder"];
if (value)
[self setSourceFolder: value];
value = [infoDict objectForKey: @"inReplyTo"];
if (value)
@@ -622,7 +655,8 @@ static NSString *userAgent = nil;
[self setText: [sourceMail contentForEditing]];
[self setSourceURL: [sourceMail imap4URLString]];
IMAP4ID = [[sourceMail nameInContainer] intValue];
[self setIMAP4ID: [[sourceMail nameInContainer] intValue]];
[self setSourceFolderWithMailObject: sourceMail];
[self storeInfo];
}
@@ -650,6 +684,9 @@ static NSString *userAgent = nil;
[self setHeaders: info];
[self setSourceURL: [sourceMail imap4URLString]];
[self setSourceFlag: @"Answered"];
[self setIMAP4ID: [[sourceMail nameInContainer] intValue]];
[self setSourceFolderWithMailObject: sourceMail];
[self storeInfo];
}
@@ -670,6 +707,8 @@ static NSString *userAgent = nil;
[self setSourceURL: [sourceMail imap4URLString]];
[self setSourceFlag: @"$Forwarded"];
[self setIMAP4ID: [[sourceMail nameInContainer] intValue]];
[self setSourceFolderWithMailObject: sourceMail];
/* attach message */
ud = [[context activeUser] userDefaults];