Closed Bug 415736 Opened 16 years ago Closed 16 years ago

delete/detach attachments in background without question for user

Categories

(Thunderbird :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3

People

(Reporter: lukas.durfina, Assigned: lukas.durfina)

Details

Attachments

(1 file, 4 obsolete files)

User-Agent:       Opera/9.23 (Windows NT 5.1; U; en)
Build Identifier: version 2.0.0.9 (20071031)

I will appreciate adding a possibility to detach/delete attachment(s) without question for user as it is acctually, when I use messenger.detachAllAttachments(...) or messenger.detachAttachment(...).
I am developing virus-checking extension, and this possibility will be usefull.
And there is at least one next extension, where it will be applicable.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Got a patch for that;) ?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hardware: PC → All
I hope, that you will think out something, because
I dont have experience with writing code to mozilla.
If I am not wrong, problem is calling of function
PromptIfDeleteAttachments(...). 
I have two ideas: make new function, where PromptIfDeleteAttachments() 
wont be called, but that will duplicate code, so I suppose, you will
refuse it. Or add the default argument to these functions, for example
DetachAllAttachments(PRUint32 aCount,
                     const char ** aContentTypeArray,
                     const char ** aUrlArray,
                     const char ** aDisplayNameArray,
                     const char ** aMessageUriArray,
                     PRBool aSaveFirst,
                     PRBool aInBackground = false);

I think the second idea is fine. Is it acceptable?
If yes, I can try to make patch.

Sounds ok to me. Though use PR_FALSE instead of false.
Attached patch patch (obsolete) — Splinter Review
I hope it will be OK, it is patch for CVS version.
I am sorry, I forgot patch for IDL file.
But I dont know how to add default parameters
in it. Can you help me?
IDL files use something like 
 [optional] in boolean 

Also remember to change the uuid for it.
Attached patch patch for idl file (obsolete) — Splinter Review
Please attach the diffs all in one file, then request r/sr - bienvenu might be the most suitable reviewer in this case. 
See http://developer.mozilla.org/en/docs/Getting_your_patch_in_the_tree
Assignee: nobody → lukas.durfina
Attachment #302381 - Attachment is obsolete: true
Attachment #302469 - Attachment is obsolete: true
Attachment #302768 - Flags: review?
Attachment #302768 - Flags: superreview?(bienvenu)
Attachment #302768 - Flags: review?(bienvenu)
Attachment #302768 - Flags: review?
Lukas, can you change the inBackground name to something more descriptive, like withoutWarning? Also

>   if (!inBackground)
>     if (NS_FAILED(PromptIfDeleteAttachments(saveFileUris != nsnull, aCount, aDisplayNameArray)))

should be just one if statement,

if (!withoutWarning && NS_FAILED(PromptIfDeleteAttachments(saveFileUris != nsnull, aCount, aDisplayNameArray)))
  return NS_OK;
Attachment #302768 - Attachment is obsolete: true
Attachment #302768 - Flags: superreview?(bienvenu)
Attachment #302768 - Flags: review?(bienvenu)
Attached patch new patch (obsolete) — Splinter Review
Thanks for reply,
I hope, it will be ok.
Attachment #304806 - Flags: superreview?
Attachment #304806 - Flags: review?
Attachment #304806 - Flags: superreview?(bienvenu)
Attachment #304806 - Flags: superreview?
Attachment #304806 - Flags: review?(bienvenu)
Attachment #304806 - Flags: review?
Attachment #304806 - Attachment is obsolete: true
Attachment #304806 - Flags: superreview?(bienvenu)
Attachment #304806 - Flags: review?(bienvenu)
I am sorry, I forget update before diff
Attachment #304812 - Flags: superreview?
Attachment #304812 - Flags: review?
Attachment #304812 - Flags: superreview?(bienvenu)
Attachment #304812 - Flags: superreview?
Attachment #304812 - Flags: review?(bienvenu)
Attachment #304812 - Flags: review?
Attachment #304812 - Attachment description: hopelly last one patch → hopefully last one patch
Comment on attachment 304812 [details] [diff] [review]
hopefully last one patch

looks good, thx, Lukas.
Attachment #304812 - Flags: superreview?(bienvenu)
Attachment #304812 - Flags: superreview+
Attachment #304812 - Flags: review?(bienvenu)
Attachment #304812 - Flags: review+
Keywords: checkin-needed
Checking in mailnews/base/public/nsIMessenger.idl;
/cvsroot/mozilla/mailnews/base/public/nsIMessenger.idl,v  <--  nsIMessenger.idl
new revision: 1.74; previous revision: 1.73
done
Checking in mailnews/base/src/nsMessenger.cpp;
/cvsroot/mozilla/mailnews/base/src/nsMessenger.cpp,v  <--  nsMessenger.cpp
new revision: 1.381; previous revision: 1.380
done
Checking in mailnews/base/src/nsMessenger.h;
/cvsroot/mozilla/mailnews/base/src/nsMessenger.h,v  <--  nsMessenger.h
new revision: 1.48; previous revision: 1.47
done
Status: NEW → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3
Version: unspecified → Trunk
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: