From a556e742fbc23acc3aa1fe96ccb5bdc59f45b59a Mon Sep 17 00:00:00 2001 From: Johannes Kanefendt Date: Fri, 10 Mar 2023 15:57:53 +0100 Subject: [PATCH 1/2] fix(mail): Store the Deleted flag in the correct (source) mailbox when moving mails across mailboxes --- SoObjects/Mailer/SOGoMailFolder.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index b84870e4b..b0a194ae7 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -794,7 +794,7 @@ static NSInteger _compareFetchResultsByUID (id entry1, id entry2, NSDictionary * if ([result isKindOfClass: [NSArray class]] && [result count] > 0) { // Copy each message to the other account - client = [[account imap4Connection] client]; + NGImap4Client *dstClient = [[account imap4Connection] client]; [[account imap4Connection] selectFolder: imapDestinationFolder]; messages = [result objectEnumerator]; result = nil; @@ -803,7 +803,7 @@ static NSInteger _compareFetchResultsByUID (id entry1, id entry2, NSDictionary * if ((content = [message valueForKey: @"message"]) != nil) { flags = [message valueForKey: @"flags"]; - result = [client append: content toFolder: imapDestinationFolder withFlags: flags]; + result = [dstClient append: content toFolder: imapDestinationFolder withFlags: flags]; if ([[result objectForKey: @"result"] boolValue]) result = nil; else From 49488efab99b0b683efa6017cfec740ba681acbe Mon Sep 17 00:00:00 2001 From: Johannes Kanefendt Date: Tue, 14 Mar 2023 08:26:23 +0100 Subject: [PATCH 2/2] Refactored variable declaration --- SoObjects/Mailer/SOGoMailFolder.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index b0a194ae7..45ccdd2bd 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -785,6 +785,7 @@ static NSInteger _compareFetchResultsByUID (id entry1, id entry2, NSDictionary * NSDictionary *message; NSData *content; NSArray *flags; + NGImap4Client *dstClient; // Fetch messages result = [client fetchUids: uids parts: [NSArray arrayWithObjects: @"RFC822", @"FLAGS", nil]]; @@ -794,7 +795,7 @@ static NSInteger _compareFetchResultsByUID (id entry1, id entry2, NSDictionary * if ([result isKindOfClass: [NSArray class]] && [result count] > 0) { // Copy each message to the other account - NGImap4Client *dstClient = [[account imap4Connection] client]; + dstClient = [[account imap4Connection] client]; [[account imap4Connection] selectFolder: imapDestinationFolder]; messages = [result objectEnumerator]; result = nil;