fix: remove useless checks and always count normal

This commit is contained in:
Anna 2021-05-15 20:40:06 -04:00
parent 90566f1435
commit 7536620e48
11 changed files with 1 additions and 86 deletions

View File

@ -129,7 +129,7 @@ namespace NoSoliciting {
}
public static bool WasEnabled(this IEnumerable<MessageCategory> enabled, MessageCategory category) {
return enabled.Contains(category);
return category == MessageCategory.Normal || enabled.Contains(category);
}
}
}

View File

@ -285,13 +285,6 @@ namespace NoSoliciting.Interface {
errorText = Language.ReportModalDisabledFilterNotEnabled;
} else if (this._reportCategory == (message.Classification ?? MessageCategory.Normal)) {
errorText = Language.ReportModalDisabledSameClassification;
} else {
switch (this.Plugin.Config.AdvancedMode) {
case true when this.Plugin.Config.MlFilters.Values.All(set => set.Count == 0):
case false when this.Plugin.Config.BasicMlFilters.Count == 0:
errorText = Language.ReportModalDisabledNoFilters;
break;
}
}
if (errorText != null) {

View File

@ -510,15 +510,6 @@ namespace NoSoliciting.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Reporting is disabled because you do not have any filters enabled..
/// </summary>
internal static string ReportModalDisabledNoFilters {
get {
return ResourceManager.GetString("ReportModalDisabledNoFilters", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Reporting is disabled because you must choose a different classification than the original..
/// </summary>
@ -582,24 +573,6 @@ namespace NoSoliciting.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Specifically, this message WAS filtered but shouldn&apos;t have been..
/// </summary>
internal static string ReportModalWasFiltered {
get {
return ResourceManager.GetString("ReportModalWasFiltered", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Specifically, this message WAS NOT filtered but should have been..
/// </summary>
internal static string ReportModalWasNotFiltered {
get {
return ResourceManager.GetString("ReportModalWasNotFiltered", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Party Finder.
/// </summary>

View File

@ -141,9 +141,6 @@
<data name="NormalCategory" xml:space="preserve">
<value>Normale Nachrichten</value>
</data>
<data name="ReportModalWasNotFiltered" xml:space="preserve">
<value>Diese Nachricht WURDE NICHT gefiltert, hätte aber gefiltert werden sollen.</value>
</data>
<data name="ReportModalHelp2" xml:space="preserve">
<value>NoSoliciting funktioniert nur für englische Nachrichten, bitte ausschließlich englische Nachrichten melden.</value>
</data>
@ -204,9 +201,6 @@
<data name="ModelTabStatus" xml:space="preserve">
<value>Status des Modells: {0}</value>
</data>
<data name="ReportModalWasFiltered" xml:space="preserve">
<value>Diese Nachricht WURDE gefiltert, hätte aber nicht gefiltert werden sollen.</value>
</data>
<data name="LogFilteredMessages" xml:space="preserve">
<value>Gefilterte Nachrichten protokollieren</value>
</data>

View File

@ -166,9 +166,6 @@
<data name="ReportModalHelp1" xml:space="preserve">
<value>Al informar de este mensaje le harás saber a la desarrolladora que crees que este mensaje ha sido clasificado de manera errónea.</value>
</data>
<data name="ReportModalWasFiltered" xml:space="preserve">
<value>Específicamente, este mensaje HA SIDO filtrado pero no debería haberlo sido.</value>
</data>
<data name="ReportModalHelp2" xml:space="preserve">
<value>NoSoliciting sólo funciona con mensajes en inglés. No informes de mensajes en otros idiomas.</value>
</data>
@ -259,9 +256,6 @@
<data name="ReportStatusMessage" xml:space="preserve">
<value>Estado del último reporte: {0}</value>
</data>
<data name="ReportModalWasNotFiltered" xml:space="preserve">
<value>Específicamente, este mensaje NO HA SIDO filtrado pero debería haberlo sido.</value>
</data>
<data name="NormalCategory" xml:space="preserve">
<value>Mensajes normales</value>
</data>

View File

@ -210,12 +210,6 @@
<data name="ReportModalHelp1" xml:space="preserve">
<value>Signaler ce message avertira la développeuse que vous pensez qu'il a été incorrectement classifié.</value>
</data>
<data name="ReportModalWasFiltered" xml:space="preserve">
<value>Plus précisément, cela veut dire que ce message A ÉTÉ filtré alors qu'il n'aurait pas dû l'être.</value>
</data>
<data name="ReportModalWasNotFiltered" xml:space="preserve">
<value>Plus précisément, cela veut dire que ce message N'A PAS ÉTÉ filtré alors qu'il aurait dû l'être.</value>
</data>
<data name="ReportModalHelp2" xml:space="preserve">
<value>NoSoliciting n'est fonctionnel que pour les messages en anglais. Veuillez ne pas signaler des messages qui ne sont pas en anglais.</value>
</data>

View File

@ -166,9 +166,6 @@
<data name="ReportModalTitle" xml:space="preserve">
<value>{0}に報告</value>
</data>
<data name="ReportModalWasNotFiltered" xml:space="preserve">
<value>具体的には、この内容はフィルタされていませんが本来フィルタリングされるべきだったと報告します。</value>
</data>
<data name="ReportModalHelp2" xml:space="preserve">
<value>NoSolicitingは英語のメッセージにのみ有効です。 他の言語でメッセージを報告しないでください。</value>
</data>
@ -256,9 +253,6 @@
<data name="ReportModalHelp1" xml:space="preserve">
<value>このメッセージを報告することで、開発者はこのメッセージが誤って分類されたことを知ることができます。</value>
</data>
<data name="ReportModalWasFiltered" xml:space="preserve">
<value>具体的には、フィルタされた内容は本来フィルタリングされるべきではなかったことを報告します。</value>
</data>
<data name="FreeCompanyCategory" xml:space="preserve">
<value>FC広告</value>
</data>

View File

@ -175,12 +175,6 @@
<data name="ReportModalTitle" xml:space="preserve">
<value>Relatar a(ao) {0}</value>
</data>
<data name="ReportModalWasFiltered" xml:space="preserve">
<value>De maneira específica, essa mensagem FOI filtrada, mas não deveria ter sido.</value>
</data>
<data name="ReportModalWasNotFiltered" xml:space="preserve">
<value>De maneira específica, essa mensagem NÃO FOI filtrada, mas deveria ter sido.</value>
</data>
<data name="ReportModalDisabledCustom" xml:space="preserve">
<value>Voçê não pode relatar as mensagens filtradas por causa de um filtro personalizado.</value>
</data>

View File

@ -144,12 +144,6 @@
<data name="ReportModalHelp1" xml:space="preserve">
<value>Reporting this message will let the developer know that you think this message was incorrectly classified.</value>
</data>
<data name="ReportModalWasFiltered" xml:space="preserve">
<value>Specifically, this message WAS filtered but shouldn't have been.</value>
</data>
<data name="ReportModalWasNotFiltered" xml:space="preserve">
<value>Specifically, this message WAS NOT filtered but should have been.</value>
</data>
<data name="ReportModalHelp2" xml:space="preserve">
<value>NoSoliciting only works for English messages. Do not report non-English messages.</value>
</data>
@ -258,9 +252,6 @@
<data name="ReportModalDisabledBadModel" xml:space="preserve">
<value>Reporting is disabled because your ML model was not functioning when you saw this message.</value>
</data>
<data name="ReportModalDisabledNoFilters" xml:space="preserve">
<value>Reporting is disabled because you do not have any filters enabled.</value>
</data>
<data name="ReportModalDisabledSameClassification" xml:space="preserve">
<value>Reporting is disabled because you must choose a different classification than the original.</value>
</data>

View File

@ -169,12 +169,6 @@
<data name="ReportModalTitle" xml:space="preserve">
<value>报告给 {0}</value>
</data>
<data name="ReportModalWasFiltered" xml:space="preserve">
<value>具体来说,这是一条正常消息,但它被错误地过滤了。</value>
</data>
<data name="ReportModalWasNotFiltered" xml:space="preserve">
<value>具体来说,这是一条应该被过滤的消息,但它被放过了。</value>
</data>
<data name="ReportModalDisabledCustom" xml:space="preserve">
<value>你不能报告被自定义过滤规则过滤的消息。</value>
</data>

View File

@ -133,12 +133,6 @@
<data name="ReportModalTitle" xml:space="preserve">
<value>報告給 {0}</value>
</data>
<data name="ReportModalWasFiltered" xml:space="preserve">
<value>具體來說,這是一條正常消息,但它被錯誤地過濾了。</value>
</data>
<data name="ReportModalWasNotFiltered" xml:space="preserve">
<value>具體來說,這是一條應該被過濾的消息,但它被略過了。</value>
</data>
<data name="ReportModalHelp2" xml:space="preserve">
<value>NoSoliciting 只對英文消息有效。請不要報告其他語言的消息。</value>
</data>