mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 03:19:24 +01:00
Inline language recognition
This commit is contained in:
@@ -239,9 +239,9 @@ public class ServiceUI extends IntentService {
|
||||
boolean plain_only = prefs.getBoolean("plain_only", false);
|
||||
|
||||
Bundle results = RemoteInput.getResultsFromIntent(intent);
|
||||
String text = results.getString("text");
|
||||
if (text != null)
|
||||
text = "<p>" + text.replaceAll("\\r?\\n", "<br>") + "</p>";
|
||||
String body = results.getString("text");
|
||||
if (body != null)
|
||||
body = "<p>" + body.replaceAll("\\r?\\n", "<br>") + "</p>";
|
||||
|
||||
DB db = DB.getInstance(this);
|
||||
try {
|
||||
@@ -281,12 +281,13 @@ public class ServiceUI extends IntentService {
|
||||
reply.id = db.message().insertMessage(reply);
|
||||
|
||||
File file = reply.getFile(this);
|
||||
Helper.writeText(file, text);
|
||||
Helper.writeText(file, body);
|
||||
|
||||
db.message().setMessageContent(reply.id,
|
||||
true,
|
||||
HtmlHelper.getLanguage(this, body),
|
||||
plain_only || ref.plain_only,
|
||||
HtmlHelper.getPreview(file),
|
||||
HtmlHelper.getPreview(body),
|
||||
null);
|
||||
|
||||
EntityOperation.queue(this, reply, EntityOperation.SEND);
|
||||
|
||||
Reference in New Issue
Block a user