Cancellazione sul server e messaggi HTML (0.8.0)
- engine/patch_engine.py applica le modifiche al motore a ogni build: log redirigibile, .delete in Mail_Pending, gd_imap_remove nello shim C, Empty che propaga la cancellazione - body() ripiega su plain e poi su html; htmltext.js riduce l'HTML a testo (10 controlli node)
This commit is contained in:
1 parent
ace59213a8
commit
c0f973cf6e
11 files changed
+358
-35
No files matched your search
@@ -2,6 +2,7 @@ import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
import "../js/linkify.js" as Linkify
|
||||
import "../js/reply.js" as Reply
|
||||
import "../js/htmltext.js" as HtmlText
|
||||
|
||||
// Lettura di un messaggio, dal motore. Paginazione a tap: un tocco sul lato
|
||||
// destro passa al successivo, sul sinistro al precedente; il corpo resta
|
||||
@@ -20,6 +21,7 @@ Page {
|
||||
property string quando: ""
|
||||
property string indirizzo: ""
|
||||
property string corpo: ""
|
||||
property string mostrato: ""
|
||||
property var allegati: []
|
||||
|
||||
Component.onCompleted: leggi()
|
||||
@@ -36,6 +38,7 @@ Page {
|
||||
page.quando = engine.cell(page.cartella, page.riga, 5);
|
||||
page.oggetto = engine.cell(page.cartella, page.riga, 7);
|
||||
page.corpo = engine.body(page.cartella, page.riga);
|
||||
page.mostrato = page.testoMostrato();
|
||||
page.allegati = engine.attachments(page.cartella, page.riga);
|
||||
// La colonna 4 e' solo il nome: per rispondere serve l'indirizzo vero.
|
||||
page.indirizzo = engine.senderOf(page.cartella, page.riga);
|
||||
@@ -51,6 +54,16 @@ Page {
|
||||
}
|
||||
}
|
||||
|
||||
function testoMostrato() {
|
||||
var t = page.corpo;
|
||||
if (t.length === 0) return "";
|
||||
// Un messaggio solo HTML arriva come markup: prima si riduce a testo,
|
||||
// poi si rendono toccabili gli indirizzi rimasti.
|
||||
if (t.indexOf("<") >= 0 && t.indexOf(">") >= 0)
|
||||
t = HtmlText.daHtml(t);
|
||||
return Linkify.html(t);
|
||||
}
|
||||
|
||||
function salvaAllegato(indice) {
|
||||
var path = engine.saveAttachment(page.cartella, page.riga, indice);
|
||||
if (path.length > 0) {
|
||||
@@ -131,8 +144,8 @@ Page {
|
||||
|
||||
Label {
|
||||
width: parent.width
|
||||
text: page.corpo.length > 0 ? Linkify.html(page.corpo)
|
||||
: qsTr("(nessun testo)")
|
||||
text: page.mostrato.length > 0 ? page.mostrato
|
||||
: qsTr("(nessun testo)")
|
||||
wrapMode: Text.Wrap
|
||||
// il testo arriva da chiunque: linkify escapa tutto e inserisce
|
||||
// solo i propri tag (vedi qml/js/linkify.js, provato con node)
|
||||
|
||||
Reference in new issue
Block a user