From f8f9d505908d8fa51266a0224fdf5f94b0be9d9d Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 28 Jan 2024 08:34:14 +0100 Subject: [PATCH] Improved error reporting --- .../java/eu/faircode/email/ActivityError.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityError.java b/app/src/main/java/eu/faircode/email/ActivityError.java index 22e8810a92..2ff9da0587 100644 --- a/app/src/main/java/eu/faircode/email/ActivityError.java +++ b/app/src/main/java/eu/faircode/email/ActivityError.java @@ -21,7 +21,9 @@ package eu.faircode.email; import android.content.Context; import android.content.Intent; +import android.net.Uri; import android.os.Bundle; +import android.text.TextUtils; import android.view.MenuItem; import android.view.View; import android.widget.Button; @@ -178,7 +180,30 @@ public class ActivityError extends ActivityBase { btnSupport.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Helper.view(v.getContext(), Helper.getSupportUri(v.getContext(), "error"), false); + StringBuilder sb = new StringBuilder(); + + sb.append(title) + .append("\n"); + + sb.append("auth_type=") + .append(ServiceAuthenticator.getAuthTypeName(auth_type)) + .append("\n"); + + if (account > 0) + sb.append("protocol=") + .append(protocol == EntityAccount.TYPE_IMAP ? "imap" : "pop3") + .append("\n"); + + if (!TextUtils.isEmpty(provider)) + sb.append("provider=") + .append(provider) + .append("\n"); + + Uri uri = Helper.getSupportUri(v.getContext(), "Sync:error") + .buildUpon() + .appendQueryParameter("message", sb.toString()) + .build(); + Helper.view(v.getContext(), uri, true); } });