[evolution-ews/gnome-3-38] I#123 - Show HTML Description in calendar entries, when available
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews/gnome-3-38] I#123 - Show HTML Description in calendar entries, when available
- Date: Tue, 22 Sep 2020 07:32:01 +0000 (UTC)
commit 1d907fac39bead8338d698480b2f61c433a50058
Author: Milan Crha <mcrha redhat com>
Date: Tue Sep 22 09:30:12 2020 +0200
I#123 - Show HTML Description in calendar entries, when available
Closes https://gitlab.gnome.org/GNOME/evolution-ews/-/issues/123
src/EWS/calendar/e-cal-backend-ews.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/src/EWS/calendar/e-cal-backend-ews.c b/src/EWS/calendar/e-cal-backend-ews.c
index 4bfb2c95..6007e730 100644
--- a/src/EWS/calendar/e-cal-backend-ews.c
+++ b/src/EWS/calendar/e-cal-backend-ews.c
@@ -74,6 +74,7 @@ struct _ECalBackendEwsPrivate {
#define GET_ITEMS_SYNC_PROPERTIES \
"item:Attachments" \
+ " item:Body" \
" item:Categories" \
" item:HasAttachments" \
" item:MimeContent" \
@@ -989,6 +990,25 @@ ecb_ews_item_to_component_sync (ECalBackendEws *cbews,
e_cal_util_component_set_x_property (icomp, "X-EVOLUTION-ITEMID", item_id->id);
e_cal_util_component_set_x_property (icomp, "X-EVOLUTION-CHANGEKEY", item_id->change_key);
+ if (e_ews_item_get_body_type (item) == E_EWS_BODY_TYPE_HTML) {
+ const gchar *html_body = e_ews_item_get_body (item);
+
+ if (html_body && *html_body) {
+ prop = i_cal_component_get_first_property (icomp, I_CAL_DESCRIPTION_PROPERTY);
+
+ /* The server can return empty HTML (with "<html><body></body></html>" only),
+ thus add it only if there was any DESCRIPTION provided as well. */
+ if (prop) {
+ g_clear_object (&prop);
+
+ prop = i_cal_property_new_x (html_body);
+ i_cal_property_set_x_name (prop, "X-ALT-DESC");
+ i_cal_property_set_parameter_from_string (prop, "FMTTYPE",
"text/html");
+ i_cal_component_take_property (icomp, prop);
+ }
+ }
+ }
+
res_component = e_cal_component_new_from_icalcomponent (i_cal_component_clone (icomp));
/* Categories */
@@ -1183,7 +1203,7 @@ ecb_ews_get_items_sync (ECalBackendEws *cbews,
add_props,
FALSE,
NULL,
- E_EWS_BODY_TYPE_TEXT,
+ E_EWS_BODY_TYPE_BEST,
&received,
NULL, NULL,
cancellable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]