Bug 1521706 - When a listener is passed to nsIMsgFolder.deleteMessages, notify it on completion; r=mkmelin
☠☠ backed out by a497d72c3d8a ☠ ☠
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 24 Jan 2019 17:53:30 +1300
changeset 33427 424dfd930d60
parent 33426 c0a224ddbe33
child 33428 e8392f4d3862
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1521706
Bug 1521706 - When a listener is passed to nsIMsgFolder.deleteMessages, notify it on completion; r=mkmelin
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/news/src/nsNewsFolder.cpp
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -2248,16 +2248,21 @@ NS_IMETHODIMP nsImapMailFolder::DeleteMe
             nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
             if (notifier)
               notifier->NotifyMsgsDeleted(messages);
           }
           DeleteStoreMessages(messages);
           database->DeleteMessages(srcKeyArray.Length(), srcKeyArray.Elements(), nullptr);
           EnableNotifications(allMessageCountNotifications, true);
         }
+        if (listener)
+        {
+          listener->OnStartCopy();
+          listener->OnStopCopy(NS_OK);
+        }
         NotifyFolderEvent(kDeleteOrMoveMsgCompleted);
       }
     }
     return rv;
   }
 
   // have to move the messages to the trash
   if(trashFolder)
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -1133,18 +1133,24 @@ nsMsgLocalMailFolder::DeleteMessages(nsI
   }
 
   bool isTrashFolder = mFlags & nsMsgFolderFlags::Trash;
 
   // notify on delete from trash and shift-delete
   if (!isMove && (deleteStorage || isTrashFolder))
   {
     nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
-    if (notifier)
-        notifier->NotifyMsgsDeleted(messages);
+    if (notifier) {
+      if (listener)
+      {
+        listener->OnStartCopy();
+        listener->OnStopCopy(NS_OK);
+      }
+      notifier->NotifyMsgsDeleted(messages);
+    }
   }
 
   if (!deleteStorage && !isTrashFolder)
   {
     nsCOMPtr<nsIMsgFolder> trashFolder;
     rv = GetTrashFolder(getter_AddRefs(trashFolder));
     if (NS_SUCCEEDED(rv))
     {
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -791,16 +791,22 @@ nsMsgNewsFolder::DeleteMessages(nsIArray
     }
     EnableNotifications(allMessageCountNotifications, true);
   }
 
   if (!isMove)
     NotifyFolderEvent(NS_SUCCEEDED(rv) ? kDeleteOrMoveMsgCompleted :
       kDeleteOrMoveMsgFailed);
 
+  if (listener)
+  {
+    listener->OnStartCopy();
+    listener->OnStopCopy(NS_OK);
+  }
+
   (void) RefreshSizeOnDisk();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::CancelMessage(nsIMsgDBHdr *msgHdr,
                                              nsIMsgWindow *aMsgWindow)
 {