From 9aa34f106c45e95e96452bbc2c6927aaa2b925b5 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Jun 2012 18:18:06 -0700 Subject: [PATCH] change dav to support new friendica event title/summary field --- dav/virtual_cal_source_friendica.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dav/virtual_cal_source_friendica.inc.php b/dav/virtual_cal_source_friendica.inc.php index 5123e4ed..7434fbbc 100644 --- a/dav/virtual_cal_source_friendica.inc.php +++ b/dav/virtual_cal_source_friendica.inc.php @@ -52,8 +52,11 @@ class FriendicaVirtualCalSourceBackend extends VirtualCalSourceBackend } */ - $subject = substr(preg_replace("/\[[^\]]*\]/", "", $row["desc"]), 0, 100); - $description = preg_replace("/\[[^\]]*\]/", "", $row["desc"]); + // 2012-06-29 - change to Friendica new event behaviour where summary is present and required, + // but use desc for older events where summary wasn't present or required (but desc was) + + $subject = (($row["summary"]) ? $row["summary"] : substr(preg_replace("/\[[^\]]*\]/", "", $row["desc"]), 0, 100)); + $description = (($row["desc"]) ? preg_replace("/\[[^\]]*\]/", "", $row["desc"]) : $row["summary"]); $vevent = dav_create_vevent(wdcal_mySql2icalTime($row["start"]), wdcal_mySql2icalTime($row["finish"]), false); $vevent->setLocation(icalendar_sanitize_string($row["location"])); -- 2.39.5