mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-06 12:30:31 +00:00
(feat) new junk/not junk capability with generic SMTP integration
Conflicts: NEWS SoObjects/Mailer/SOGoMailAccount.m SoObjects/SOGo/SOGoDefaults.plist SoObjects/SOGo/SOGoUser.m UI/MailerUI/UIxMailFolderActions.h UI/MailerUI/UIxMailFolderActions.m UI/MailerUI/product.plist
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* UIxMailFolderActions.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007-2014 Inverse inc.
|
||||
* Copyright (C) 2007-2016 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -631,6 +631,11 @@
|
||||
return [self _setFolderPurpose: @"Trash"];
|
||||
}
|
||||
|
||||
- (WOResponse *) setAsJunkFolderAction
|
||||
{
|
||||
return [self _setFolderPurpose: @"Junk"];
|
||||
}
|
||||
|
||||
- (WOResponse *) expungeAction
|
||||
{
|
||||
SOGoMailAccount *account;
|
||||
@@ -830,5 +835,36 @@
|
||||
return response;
|
||||
}
|
||||
|
||||
- (WOResponse *) _markMessagesAsJunkOrNotJunk: (BOOL) isJunk
|
||||
{
|
||||
NSDictionary *content;
|
||||
WOResponse *response;
|
||||
WORequest *request;
|
||||
SOGoMailFolder *co;
|
||||
NSArray *uids;
|
||||
|
||||
request = [context request];
|
||||
content = [[request contentAsString] objectFromJSONString];
|
||||
uids = [NSArray arrayWithArray: [content objectForKey:@"uids"]];
|
||||
|
||||
co = [self clientObject];
|
||||
|
||||
if ([co markMessagesAsJunkOrNotJunk: uids junk: isJunk])
|
||||
response = [self responseWithStatus: 500];
|
||||
else
|
||||
response = [self responseWith204];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
- (WOResponse *) markMessagesAsJunkAction
|
||||
{
|
||||
return [self _markMessagesAsJunkOrNotJunk: YES];
|
||||
}
|
||||
|
||||
- (WOResponse *) markMessagesAsNotJunkAction
|
||||
{
|
||||
return [self _markMessagesAsJunkOrNotJunk: NO];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user