From 95f372e52f09f70851f60c4000c9b39587b920a5 Mon Sep 17 00:00:00 2001 From: mkersten Date: Fri, 28 Oct 2005 21:07:00 +0000 Subject: Patch for Bug #108305: Commenting from Mylar's Bugzilla UI doesn't update CC --- .../mylyn/bugzilla/ui/editor/ExistingBugEditor.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java index 25203dc2b..a261b0c1d 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java @@ -41,6 +41,7 @@ import org.eclipse.mylar.bugzilla.core.BugPost; import org.eclipse.mylar.bugzilla.core.BugReport; import org.eclipse.mylar.bugzilla.core.BugzillaException; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; +import org.eclipse.mylar.bugzilla.core.BugzillaPreferences; import org.eclipse.mylar.bugzilla.core.BugzillaRepository; import org.eclipse.mylar.bugzilla.core.Comment; import org.eclipse.mylar.bugzilla.core.IBugzillaBug; @@ -326,6 +327,9 @@ public class ExistingBugEditor extends AbstractBugEditor // set the url for the bug to be submitted to setURL(form, "process_bug.cgi"); + //Add the user's address to the CC list if they haven't specified a CC + setDefaultCCValue(); + // go through all of the attributes and add them to the bug post for (Iterator it = bug.getAttributes().iterator(); it.hasNext(); ) { Attribute a = it.next(); @@ -959,6 +963,20 @@ public class ExistingBugEditor extends AbstractBugEditor } } + /** + * Sets the cc field to the user's address if a cc has not been + * specified to ensure that commenters are on the cc list. + * @author Wesley Coelho + */ + private void setDefaultCCValue(){ + Attribute attr = bug.getAttributeForKnobName("newcc"); + if(attr != null) { + if (attr.getNewValue().equals("")){ + attr.setNewValue(BugzillaPreferences.getUserName()); + } + } + } + // TODO used for spell checking. Add back when we want to support this // protected Button checkSpellingButton; // -- cgit v1.2.3