Improved error reporting

This commit is contained in:
M66B 2024-01-28 08:34:14 +01:00
parent dcb424a5eb
commit f8f9d50590
1 changed files with 26 additions and 1 deletions

View File

@ -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);
}
});