Add a User Preference to Receive only Plaintext Emails
This adds a user preference such that we only send plaintext emails to this user. It also adds docs and tests. For the user, this comes at the cost of not being in the same email thread as the users who receive HTML emails. We decided to send out plaintext emails on a one-by-one basis instead of making one thread (as we do with HTML) as this would just create more confusion. When admins enable inbound email for Gerrit, the aforementioned caveat isn't a problem anymore as users would email Gerrit anyway instead of using a notification email as messaging thread. Change-Id: I3d0fc920c9d81e1a7b707ae5f3f4600a62b8a93b
This commit is contained in:
@@ -22,6 +22,7 @@ import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailFormat;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.ReviewCategoryStrategy;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat;
|
||||
@@ -52,6 +53,7 @@ public class GeneralPreferences extends JavaScriptObject {
|
||||
p.legacycidInChangeTable(d.legacycidInChangeTable);
|
||||
p.muteCommonPathPrefixes(d.muteCommonPathPrefixes);
|
||||
p.signedOffBy(d.signedOffBy);
|
||||
p.emailFormat(d.emailFormat);
|
||||
p.reviewCategoryStrategy(d.getReviewCategoryStrategy());
|
||||
p.diffView(d.getDiffView());
|
||||
p.emailStrategy(d.emailStrategy);
|
||||
@@ -132,6 +134,13 @@ public class GeneralPreferences extends JavaScriptObject {
|
||||
|
||||
private native String emailStrategyRaw() /*-{ return this.email_strategy }-*/;
|
||||
|
||||
public final EmailFormat emailFormat() {
|
||||
String s = emailFormatRaw();
|
||||
return s != null ? EmailFormat.valueOf(s) : null;
|
||||
}
|
||||
|
||||
private native String emailFormatRaw() /*-{ return this.email_format }-*/;
|
||||
|
||||
public final DefaultBase defaultBaseForMerges() {
|
||||
String s = defaultBaseForMergesRaw();
|
||||
return s != null ? DefaultBase.valueOf(s) : null;
|
||||
@@ -203,6 +212,12 @@ public class GeneralPreferences extends JavaScriptObject {
|
||||
|
||||
private native void emailStrategyRaw(String s) /*-{ this.email_strategy = s }-*/;
|
||||
|
||||
public final void emailFormat(EmailFormat f) {
|
||||
emailFormatRaw(f != null ? f.toString() : null);
|
||||
}
|
||||
|
||||
private native void emailFormatRaw(String s) /*-{ this.email_format = s }-*/;
|
||||
|
||||
public final void defaultBaseForMerges(DefaultBase b) {
|
||||
defaultBaseForMergesRaw(b != null ? b.toString() : null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user