Put bug report app names in config

This commit is contained in:
Valere 2022-01-25 16:35:16 +01:00
parent 553e55b4d1
commit 14da9806e2
2 changed files with 6 additions and 4 deletions

View file

@ -265,7 +265,7 @@ class BugReporter @Inject constructor(
// build the multi part request // build the multi part request
val builder = BugReporterMultipartBody.Builder() val builder = BugReporterMultipartBody.Builder()
.addFormDataPart("text", text) .addFormDataPart("text", text)
.addFormDataPart("app", rageShakeAppNameForReport(reportType)) .addFormDataPart("app", rageShakeAppNameForReport(context, reportType))
.addFormDataPart("user_agent", Matrix.getInstance(context).getUserAgent()) .addFormDataPart("user_agent", Matrix.getInstance(context).getUserAgent())
.addFormDataPart("user_id", userId) .addFormDataPart("user_id", userId)
.addFormDataPart("can_contact", canContact.toString()) .addFormDataPart("can_contact", canContact.toString())
@ -487,7 +487,7 @@ class BugReporter @Inject constructor(
activity.startActivity(BugReportActivity.intent(activity, reportType)) activity.startActivity(BugReportActivity.intent(activity, reportType))
} }
private fun rageShakeAppNameForReport(reportType: ReportType): String { private fun rageShakeAppNameForReport(context: Context, reportType: ReportType): String {
// As per https://github.com/matrix-org/rageshake // As per https://github.com/matrix-org/rageshake
// app: Identifier for the application (eg 'riot-web'). // app: Identifier for the application (eg 'riot-web').
// Should correspond to a mapping configured in the configuration file for github issue reporting to work. // Should correspond to a mapping configured in the configuration file for github issue reporting to work.
@ -495,10 +495,10 @@ class BugReporter @Inject constructor(
return when (reportType) { return when (reportType) {
ReportType.AUTO_UISI_SENDER, ReportType.AUTO_UISI_SENDER,
ReportType.AUTO_UISI -> { ReportType.AUTO_UISI -> {
"element-auto-uisi" context.getString(R.string.bug_report_auto_uisi_app_name)
} }
else -> { else -> {
"riot-android" context.getString(R.string.bug_report_app_name)
} }
} }
} }

View file

@ -7,6 +7,8 @@
<string name="matrix_org_server_url" translatable="false">https://matrix.org</string> <string name="matrix_org_server_url" translatable="false">https://matrix.org</string>
<string name="piwik_server_url" translatable="false">https://piwik.riot.im</string> <string name="piwik_server_url" translatable="false">https://piwik.riot.im</string>
<string name="bug_report_url" translatable="false">https://riot.im/bugreports/submit</string> <string name="bug_report_url" translatable="false">https://riot.im/bugreports/submit</string>
<string name="bug_report_app_name" translatable="false">riot-android</string>
<string name="bug_report_auto_uisi_app_name" translatable="false">element-auto-uisi</string>
<!-- <!--
Pusher config for the application Pusher config for the application