Added message link to shared text

This commit is contained in:
M66B 2021-04-12 08:52:17 +02:00
parent 3e80acdd01
commit 49fcf40c45
1 changed files with 7 additions and 8 deletions

View File

@ -4825,22 +4825,21 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (!TextUtils.isEmpty(message.subject))
result.put("subject", message.subject);
String html = Helper.readText(file);
String text = HtmlHelper.getText(context, html);
String link = "message://" + BuildConfig.APPLICATION_ID + "/" + message.id;
Document document = JsoupEx.parse(html);
Document document = JsoupEx.parse(file);
Element a = document.createElement("a");
a.text(context.getString(R.string.app_name));
a.attr("href", "message://" + BuildConfig.APPLICATION_ID + "/" + message.id);
a.attr("href", link);
document.body().appendElement("p").appendChild(a);
result.put("html", document.body().html());
if (!TextUtils.isEmpty(text))
result.put("text", text);
String html = document.body().html();
String text = HtmlHelper.getText(context, html);
result.put("html", html);
result.put("text", text);
result.put("attachments", db.attachment().getAttachments(message.id));
return result;