From 1c8f309c33628bd6c540263eca9b2ff82057e46d Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 22 Sep 2016 16:08:59 -0400 Subject: [PATCH] Automatically mark msg as read in Mail module --- SoObjects/Mailer/SOGoMailObject.m | 12 ++++++++++++ UI/MailerUI/UIxMailView.m | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 38e9db674..d38196f70 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -84,6 +84,18 @@ static BOOL debugSoParts = NO; } } +- (id) init +{ + if ((self = [super init])) + { + headers = nil; + headerPart = nil; + coreInfos = nil; + } + + return self; +} + - (void) dealloc { [headers release]; diff --git a/UI/MailerUI/UIxMailView.m b/UI/MailerUI/UIxMailView.m index 6f3b60b24..02888400d 100644 --- a/UI/MailerUI/UIxMailView.m +++ b/UI/MailerUI/UIxMailView.m @@ -278,9 +278,6 @@ static NSString *mailETag = nil; andJSONRepresentation: data]; } - // Mark message as read - [co addFlags: @"seen"]; - data = [NSMutableDictionary dictionaryWithObjectsAndKeys: [self attachmentAttrs], @"attachmentAttrs", [self shouldAskReceipt], @"shouldAskReceipt", @@ -302,6 +299,9 @@ static NSString *mailETag = nil; if ((addresses = [addressFormatter dictionariesForArray: [co replyToEnvelopeAddresses]])) [data setObject: addresses forKey: @"reply-to"]; + // Mark message as read + [co addFlags: @"seen"]; + response = [self responseWithStatus: 200 andJSONRepresentation: data];