diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java
index bb633adad7..f4b919cd64 100644
--- a/app/src/main/java/eu/faircode/email/FragmentCompose.java
+++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java
@@ -2704,13 +2704,6 @@ public class FragmentCompose extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String model = prefs.getString("openai_model", OpenAI.DEFAULT_MODEL);
float temperature = prefs.getFloat("openai_temperature", OpenAI.DEFAULT_TEMPERATURE);
- boolean moderation = prefs.getBoolean("openai_moderation", false);
-
- if (moderation)
- for (OpenAI.Message message : result)
- for (OpenAI.Content content : message.getContent())
- if (OpenAI.CONTENT_TEXT.equals(content.getContent()))
- OpenAI.checkModeration(context, content.getContent());
OpenAI.Message[] completions =
OpenAI.completeChat(context, model, result.toArray(new OpenAI.Message[0]), temperature, 1);
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsIntegrations.java b/app/src/main/java/eu/faircode/email/FragmentOptionsIntegrations.java
index bd201b7777..199abfdfc6 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsIntegrations.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsIntegrations.java
@@ -82,7 +82,6 @@ public class FragmentOptionsIntegrations extends FragmentBase implements SharedP
private EditText etOpenAiModel;
private TextView tvOpenAiTemperature;
private SeekBar sbOpenAiTemperature;
- private SwitchCompat swOpenAiModeration;
private EditText etOpenAiSummarize;
private ImageButton ibOpenAi;
private SwitchCompat swGemini;
@@ -107,7 +106,7 @@ public class FragmentOptionsIntegrations extends FragmentBase implements SharedP
"deepl_enabled",
"vt_enabled",
"send_enabled", "send_host", "send_dlimit", "send_tlimit",
- "openai_enabled", "openai_uri", "openai_model", "openai_temperature", "openai_moderation", "openai_summarize",
+ "openai_enabled", "openai_uri", "openai_model", "openai_temperature", "openai_summarize",
"gemini_enabled", "gemini_uri", "gemini_model", "gemini_temperature", "gemini_summarize"
));
@@ -155,7 +154,6 @@ public class FragmentOptionsIntegrations extends FragmentBase implements SharedP
etOpenAiModel = view.findViewById(R.id.etOpenAiModel);
tvOpenAiTemperature = view.findViewById(R.id.tvOpenAiTemperature);
sbOpenAiTemperature = view.findViewById(R.id.sbOpenAiTemperature);
- swOpenAiModeration = view.findViewById(R.id.swOpenAiModeration);
etOpenAiSummarize = view.findViewById(R.id.etOpenAiSummarize);
ibOpenAi = view.findViewById(R.id.ibOpenAi);
@@ -422,7 +420,6 @@ public class FragmentOptionsIntegrations extends FragmentBase implements SharedP
prefs.edit().putBoolean("openai_enabled", checked).apply();
etOpenAiModel.setEnabled(checked);
sbOpenAiTemperature.setEnabled(checked);
- swOpenAiModeration.setEnabled(checked);
etOpenAiSummarize.setEnabled(checked);
if (checked)
swGemini.setChecked(false);
@@ -520,13 +517,6 @@ public class FragmentOptionsIntegrations extends FragmentBase implements SharedP
}
});
- swOpenAiModeration.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
- prefs.edit().putBoolean("openai_moderation", checked).apply();
- }
- });
-
etOpenAiSummarize.setHint(OpenAI.SUMMARY_PROMPT);
etOpenAiSummarize.addTextChangedListener(new TextWatcher() {
@Override
@@ -793,10 +783,6 @@ public class FragmentOptionsIntegrations extends FragmentBase implements SharedP
tvOpenAiTemperature.setText(getString(R.string.title_advanced_openai_temperature, NF.format(temperature)));
sbOpenAiTemperature.setProgress(Math.round(temperature * 10));
sbOpenAiTemperature.setEnabled(swOpenAi.isChecked());
-
- swOpenAiModeration.setChecked(prefs.getBoolean("openai_moderation", false));
- swOpenAiModeration.setEnabled(swOpenAi.isChecked());
-
etOpenAiSummarize.setText(prefs.getString("openai_summarize", null));
etOpenAiSummarize.setEnabled(swOpenAi.isChecked());
diff --git a/app/src/main/res/layout/fragment_options_integrations.xml b/app/src/main/res/layout/fragment_options_integrations.xml
index 95ed418c83..cd04772d73 100644
--- a/app/src/main/res/layout/fragment_options_integrations.xml
+++ b/app/src/main/res/layout/fragment_options_integrations.xml
@@ -589,18 +589,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOpenAiTemperature" />
-
-
+ app:layout_constraintTop_toBottomOf="@id/sbOpenAiTemperature" />