Composer.Widget: Handle non-Geary HTML and plain text drafts better
Commit 37d904b5 added a partial change to how drafts are saved and loaded - saving plain text only when not in rich text mode and loading HTML-based drafts that don't seem to have originated from Geary and plain-text-only drafts as the body so that Geary's composer-internal HTML markup is still present. However this introduced a double signature when loading plain text drafts back since Geary would assume the body (including sig) is the message body and appending a new sig to that. This addresses the issue above by always saving drafts with HTML parts even when in plain text only mode.
This commit is contained in:
parent
44654e3f76
commit
29ba9311e6
1 changed files with 7 additions and 7 deletions
|
|
@ -882,7 +882,7 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
|
|||
}
|
||||
update_extended_headers();
|
||||
|
||||
yield finish_loading(body, complete_quote, (type == EDIT));
|
||||
yield finish_loading(body, complete_quote, body_complete);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1407,12 +1407,12 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
|
|||
|
||||
try {
|
||||
email.body_text = yield this.editor.get_text();
|
||||
if (this.editor.is_rich_text) {
|
||||
email.body_html = (
|
||||
for_draft
|
||||
? yield this.editor.get_html_for_draft()
|
||||
: yield this.editor.get_html()
|
||||
);
|
||||
if (for_draft) {
|
||||
// Must save HTML even if in plain text mode since we
|
||||
// need it to restore body/sig/reply state
|
||||
email.body_html = yield this.editor.get_html_for_draft();
|
||||
} else if (this.editor.is_rich_text) {
|
||||
email.body_html = yield this.editor.get_html();
|
||||
}
|
||||
} catch (Error error) {
|
||||
debug("Error getting composer message body: %s", error.message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue