[evolution/gnome-3-24] Bug 782153 - Missing name when replying to sender with quotes
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-24] Bug 782153 - Missing name when replying to sender with quotes
- Date: Fri, 5 May 2017 07:21:56 +0000 (UTC)
commit d9d45bcec5586d972e10761fb256a0315d8ea781
Author: Milan Crha <mcrha redhat com>
Date: Fri May 5 09:18:50 2017 +0200
Bug 782153 - Missing name when replying to sender with quotes
src/em-format/e-mail-formatter-quote.c | 2 +-
src/mail/em-composer-utils.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/em-format/e-mail-formatter-quote.c b/src/em-format/e-mail-formatter-quote.c
index 24abcbb..e224049 100644
--- a/src/em-format/e-mail-formatter-quote.c
+++ b/src/em-format/e-mail-formatter-quote.c
@@ -118,7 +118,7 @@ mail_formatter_quote_run (EMailFormatter *formatter,
* So if we want to put something into the message we have to put it into
* the special span element and it will be moved to body in EHTMLEditorView */
if (qf->priv->credits && *qf->priv->credits) {
- gchar *credits = g_strdup_printf (
+ gchar *credits = g_markup_printf_escaped (
"<span class=\"-x-evo-to-body\" data-credits=\"%s\"></span>",
qf->priv->credits);
g_output_stream_write_all (
diff --git a/src/mail/em-composer-utils.c b/src/mail/em-composer-utils.c
index 00335a6..95e5d1b 100644
--- a/src/mail/em-composer-utils.c
+++ b/src/mail/em-composer-utils.c
@@ -3066,10 +3066,28 @@ format_sender (GString *str,
{
CamelInternetAddress *sender;
const gchar *name, *addr = NULL;
+ gchar *tmp = NULL;
sender = camel_mime_message_get_from (message);
if (sender != NULL && camel_address_length (CAMEL_ADDRESS (sender)) > 0) {
camel_internet_address_get (sender, 0, &name, &addr);
+
+ if (name && !*name) {
+ name = NULL;
+ } else if (name && *name == '\"') {
+ gint len = strlen (name);
+
+ if (len == 1) {
+ name = NULL;
+ } else if (len > 1 && name[len - 1] == '\"') {
+ if (len == 2) {
+ name = NULL;
+ } else {
+ tmp = g_strndup (name + 1, len - 2);
+ name = tmp;
+ }
+ }
+ }
} else {
name = _("an unknown sender");
}
@@ -3083,6 +3101,8 @@ format_sender (GString *str,
} else if (addr) {
g_string_append (str, addr);
}
+
+ g_free (tmp);
}
static struct {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]