mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-02 18:15:26 +00:00
Removed charset from content-type
Monotone-Parent: 9281789fc046d7e0135be9fbb84b728e14218579 Monotone-Revision: 8d4d276429e5192f98568aecf0d0c541440d22fc Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-10-01T13:59:04 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1269,4 +1269,134 @@ static BOOL debugSoParts = NO;
|
||||
return response;
|
||||
}
|
||||
|
||||
// For DAV REPORT
|
||||
- (id) _fetchProperty: (NSString *) property
|
||||
{
|
||||
NSArray *parts;
|
||||
id rc, msgs;
|
||||
|
||||
rc = nil;
|
||||
|
||||
if (property)
|
||||
{
|
||||
parts = [NSArray arrayWithObjects: property, nil];
|
||||
|
||||
msgs = [self fetchParts: parts];
|
||||
msgs = [msgs valueForKey: @"fetch"];
|
||||
if ([msgs count]) {
|
||||
rc = [msgs objectAtIndex: 0];
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (BOOL) _hasFlag: (NSString *) flag
|
||||
{
|
||||
BOOL rc;
|
||||
NSDictionary *values;
|
||||
NSArray *flags;
|
||||
|
||||
rc = NO;
|
||||
values = [self _fetchProperty: @"FLAGS"];
|
||||
|
||||
if (values)
|
||||
{
|
||||
flags = [values objectForKey: @"flags"];
|
||||
rc = [flags containsObject: flag];
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (NSArray *) _emailAddressesFrom: (NSArray *) enveloppeAddresses
|
||||
{
|
||||
NSMutableArray *rc;
|
||||
NGImap4EnvelopeAddress *address;
|
||||
NSString *email;
|
||||
int count, max;
|
||||
|
||||
rc = nil;
|
||||
max = [enveloppeAddresses count];
|
||||
|
||||
if (max > 0)
|
||||
{
|
||||
rc = [NSMutableArray array];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
address = [enveloppeAddresses objectAtIndex: count];
|
||||
email = [NSString stringWithFormat: @"%@", [address email]];
|
||||
|
||||
[rc addObject: email]; //TODO: Bug with escaping...
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Properties
|
||||
|
||||
//{urn:schemas:httpmail:}
|
||||
// date is already done
|
||||
|
||||
- (BOOL) hasAttachment
|
||||
{
|
||||
return ([[self fetchAttachmentIds] count] > 0);
|
||||
}
|
||||
|
||||
- (BOOL) read
|
||||
{
|
||||
return [self _hasFlag: @"seen"];
|
||||
}
|
||||
|
||||
- (NSString *) textDescription
|
||||
{
|
||||
return @"TODO";
|
||||
}
|
||||
|
||||
|
||||
//{urn:schemas:mailheader:}
|
||||
|
||||
- (NSArray *) cc
|
||||
{
|
||||
return [self _emailAddressesFrom: [self ccEnvelopeAddresses]];
|
||||
}
|
||||
|
||||
// date is already done
|
||||
|
||||
- (NSArray *) from
|
||||
{
|
||||
return [self _emailAddressesFrom: [self fromEnvelopeAddresses]];
|
||||
}
|
||||
|
||||
- (NSString *) inReplyTo
|
||||
{
|
||||
return [[self envelope] inReplyTo];
|
||||
}
|
||||
|
||||
- (NSString *) messageId
|
||||
{
|
||||
return [[self envelope] messageID]; //TODO Bug escaping
|
||||
}
|
||||
|
||||
- (NSString *) received
|
||||
{
|
||||
return @"TODO";
|
||||
}
|
||||
|
||||
- (NSString *) references
|
||||
{
|
||||
return @"TODO";
|
||||
}
|
||||
|
||||
- (NSString *) davDisplayName
|
||||
{
|
||||
return [self subject];
|
||||
}
|
||||
|
||||
- (NSArray *) to
|
||||
{
|
||||
return [self _emailAddressesFrom: [self toEnvelopeAddresses]];
|
||||
}
|
||||
|
||||
|
||||
@end /* SOGoMailObject */
|
||||
|
||||
@@ -122,7 +122,7 @@ class DAVMailCollectionTest(unittest.TestCase):
|
||||
# message creation on collection url
|
||||
url = "%s%s" % (self.resource, "foldertest-dav-mail/")
|
||||
put = webdavlib.HTTPPUT (url, message1)
|
||||
put.content_type = "message/rfc822; charset=utf-8"
|
||||
put.content_type = "message/rfc822"
|
||||
self.client.execute (put)
|
||||
self.assertEquals(put.response["status"], 201,
|
||||
"failure putting message"
|
||||
@@ -138,7 +138,7 @@ class DAVMailCollectionTest(unittest.TestCase):
|
||||
# message creation with explicit filename
|
||||
url = "%s%s" % (self.resource, "foldertest-dav-mail/blabla.eml")
|
||||
put = webdavlib.HTTPPUT (url, message1)
|
||||
put.content_type = "message/rfc822; charset=utf-8"
|
||||
put.content_type = "message/rfc822"
|
||||
self.client.execute (put)
|
||||
self.assertEquals(put.response["status"], 201,
|
||||
"failure putting message"
|
||||
|
||||
Reference in New Issue
Block a user