diff options
author | Patrick Hiesel <hiesel@google.com> | 2017-02-10 16:20:57 +0100 |
---|---|---|
committer | Patrick Hiesel <hiesel@google.com> | 2017-02-14 15:32:52 +0100 |
commit | 39777363a63c603cfa68ca52d2f3c99eb04f2f46 (patch) | |
tree | 88102c3bcb7056f327a2e928e870b6e3d1f9d068 /gerrit-gwtui-common | |
parent | 2f48a8517676f8c8f094373d7da6b42cee688267 (diff) |
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
Diffstat (limited to 'gerrit-gwtui-common')
-rw-r--r-- | gerrit-gwtui-common/src/main/java/com/google/gerrit/client/info/GeneralPreferences.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/info/GeneralPreferences.java b/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/info/GeneralPreferences.java index 6f91440eb5..23e1a93ac6 100644 --- a/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/info/GeneralPreferences.java +++ b/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/info/GeneralPreferences.java @@ -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); } |