[Asterisk-code-review] res calendar caldav: Add support reading gmail calendar (asterisk[14])

Eduardo Scudeller Libardi asteriskteam at digium.com
Wed Nov 30 13:18:35 CST 2016


Eduardo Scudeller Libardi has uploaded a new change for review. ( https://gerrit.asterisk.org/4535 )

Change subject: res_calendar_caldav: Add support reading gmail calendar
......................................................................

res_calendar_caldav: Add support reading gmail calendar

The response from gmail calendar includes the string name
"caldav:calendar-data". res_calendar_caldav implements
the example included in RFC 4791: string "C:calendar-data".
When reading the calendar, res_calendar_caldav compare the
string and if does not match just discards the event.
This commit compares the response to both strings,
successfully loading gmail calendar events.
Writing to gmail calendar is working prior to this fix.

ASTERISK-26624
Reported by: Eduardo S. Libardi

Change-Id: Ia1eef10552ae616efb645d390f5ffe81260d7d4a
---
M res/res_calendar_caldav.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/35/4535/1

diff --git a/res/res_calendar_caldav.c b/res/res_calendar_caldav.c
index 5904085..596d2d8 100644
--- a/res/res_calendar_caldav.c
+++ b/res/res_calendar_caldav.c
@@ -482,7 +482,7 @@
 {
 	struct xmlstate *state = data;
 
-	if (!xmlStrcasecmp(fullname, BAD_CAST "C:calendar-data")) {
+	if (!xmlStrcasecmp(fullname, BAD_CAST "C:calendar-data") || !xmlStrcasecmp(fullname, BAD_CAST "caldav:calendar-data")) {
 		state->in_caldata = 1;
 		ast_str_reset(state->cdata);
 	}
@@ -496,7 +496,7 @@
 	icalcomponent *iter;
 	icalcomponent *comp;
 
-	if (xmlStrcasecmp(name, BAD_CAST "C:calendar-data")) {
+	if (xmlStrcasecmp(name, BAD_CAST "C:calendar-data") && xmlStrcasecmp(name, BAD_CAST "caldav:calendar-data")) {
 		return;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/4535
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1eef10552ae616efb645d390f5ffe81260d7d4a
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Eduardo Scudeller Libardi <eslibardi at gmail.com>



More information about the asterisk-code-review mailing list