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
+28
-6
@@ -43,6 +43,8 @@ gd_queue_sent_fn EngineBridge::s_queue_sent = nullptr;
|
||||
gd_place_fn EngineBridge::s_place = nullptr;
|
||||
gd_log_fn EngineBridge::s_log = nullptr;
|
||||
gd_empty_fn EngineBridge::s_empty = nullptr;
|
||||
gd_text_fn EngineBridge::s_plain = nullptr;
|
||||
gd_text_fn EngineBridge::s_html = nullptr;
|
||||
|
||||
// Colonne del motore (enum Column di qt_shim.cpp)
|
||||
enum Column { Status, Priority, Attachment, Label, Who, Date, Size, Subject, Junk };
|
||||
@@ -74,7 +76,8 @@ void EngineBridge::keepCallbacks(gd_folder_fn folder, gd_open_fn open, gd_cell_f
|
||||
gd_find_poll_fn send_poll,
|
||||
gd_send_done_fn send_done,
|
||||
gd_queue_sent_fn queue_sent, gd_place_fn place,
|
||||
gd_log_fn log, gd_empty_fn empty)
|
||||
gd_log_fn log, gd_empty_fn empty,
|
||||
gd_text_fn plain, gd_text_fn html)
|
||||
{
|
||||
s_folder = folder;
|
||||
s_open = open;
|
||||
@@ -102,6 +105,8 @@ void EngineBridge::keepCallbacks(gd_folder_fn folder, gd_open_fn open, gd_cell_f
|
||||
s_place = place;
|
||||
s_log = log;
|
||||
s_empty = empty;
|
||||
s_plain = plain;
|
||||
s_html = html;
|
||||
if (s_instance) {
|
||||
emit s_instance->ready();
|
||||
}
|
||||
@@ -710,12 +715,29 @@ QVariantList EngineBridge::messages(int folder)
|
||||
|
||||
QString EngineBridge::body(int folder, int row)
|
||||
{
|
||||
if (!s_body) return QString();
|
||||
char buf[65536];
|
||||
int n = s_body(folder, row, buf, int(sizeof buf) - 1);
|
||||
if (n <= 0) return QString();
|
||||
if (n > int(sizeof buf) - 1) n = int(sizeof buf) - 1;
|
||||
return QString::fromUtf8(buf, n);
|
||||
|
||||
// Il testo che il motore prepara per la lettura. Se il messaggio e' solo
|
||||
// HTML quel testo puo' mancare: allora la parte di testo del MIME e, in
|
||||
// ultima istanza, l'HTML grezzo (che la pagina riduce a testo, vedi
|
||||
// qml/js/htmltext.js).
|
||||
if (s_body) {
|
||||
const int n = s_body(folder, row, buf, int(sizeof buf) - 1);
|
||||
if (n > 0) return QString::fromUtf8(buf, qMin(n, int(sizeof buf) - 1));
|
||||
}
|
||||
if (!s_id_of) return QString();
|
||||
const int id = s_id_of(folder, row);
|
||||
if (id < 0) return QString();
|
||||
|
||||
if (s_plain) {
|
||||
const int n = s_plain(folder, id, buf, int(sizeof buf) - 1);
|
||||
if (n > 0) return QString::fromUtf8(buf, qMin(n, int(sizeof buf) - 1));
|
||||
}
|
||||
if (s_html) {
|
||||
const int n = s_html(folder, id, buf, int(sizeof buf) - 1);
|
||||
if (n > 0) return QString::fromUtf8(buf, qMin(n, int(sizeof buf) - 1));
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
// Gli allegati del messaggio, come li dà il motore: per ognuno nome (UTF-8),
|
||||
|
||||
+4
-1
@@ -45,7 +45,8 @@ public:
|
||||
gd_find_poll_fn send_poll,
|
||||
gd_send_done_fn send_done,
|
||||
gd_queue_sent_fn queue_sent, gd_place_fn place,
|
||||
gd_log_fn log, gd_empty_fn empty);
|
||||
gd_log_fn log, gd_empty_fn empty,
|
||||
gd_text_fn plain, gd_text_fn html);
|
||||
|
||||
bool checking() const { return m_checking; }
|
||||
QString lastResult() const { return m_lastResult; }
|
||||
@@ -117,6 +118,8 @@ private:
|
||||
static gd_place_fn s_place;
|
||||
static gd_log_fn s_log;
|
||||
static gd_empty_fn s_empty;
|
||||
static gd_text_fn s_plain;
|
||||
static gd_text_fn s_html;
|
||||
// Un mio passaggio scritto nel log del motore: senza, quando l'invio si
|
||||
// ferma prima del motore non resta traccia di niente.
|
||||
void logInvio(const QString &riga);
|
||||
|
||||
@@ -46,8 +46,7 @@ int gd_run(gd_folder_fn folder, gd_open_fn open, gd_cell_fn cell,
|
||||
{
|
||||
(void)sort; (void)mark_read; (void)id_of; (void)row_of; (void)move;
|
||||
(void)commit; (void)priority; (void)label;
|
||||
(void)decrypt; (void)key_of; (void)plain;
|
||||
(void)sheet; (void)filter; (void)last_id;
|
||||
(void)decrypt; (void)key_of; (void)sheet; (void)filter; (void)last_id;
|
||||
(void)find_start; (void)find_poll; (void)find_cancel; (void)id_named;
|
||||
(void)imap_start; (void)imap_poll; (void)absorb; (void)rescan;
|
||||
(void)shown_at; (void)can_hold; (void)make_folder; (void)can_change;
|
||||
@@ -61,7 +60,7 @@ int gd_run(gd_folder_fn folder, gd_open_fn open, gd_cell_fn cell,
|
||||
imap_start, imap_poll, rescan, attachments, sort,
|
||||
absorb, sender, header, compose, claim,
|
||||
send_start, send_poll, send_done, queue_sent,
|
||||
place, log, empty);
|
||||
place, log, empty, plain, html);
|
||||
return QCoreApplication::exec();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -24,9 +24,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
|
||||
|
||||
app->setOrganizationName(QStringLiteral("harbour"));
|
||||
app->setApplicationName(QStringLiteral("grumpydove"));
|
||||
app->setApplicationVersion(QStringLiteral("0.7.2"));
|
||||
app->setApplicationVersion(QStringLiteral("0.8.0"));
|
||||
|
||||
qDebug() << "harbour-grumpydove v0.7.2 build" << __DATE__ << __TIME__;
|
||||
qDebug() << "harbour-grumpydove v0.8.0 build" << __DATE__ << __TIME__;
|
||||
|
||||
// La sandbox di Sailfish (SailJail) non lascia vedere ~/Mail, ma il motore
|
||||
// legge il percorso del Maildir da GRUMPYDOVE_MAIL: si punta alla cartella
|
||||
|
||||
Reference in new issue
Block a user