]> git.mxchange.org Git - friendica-addons.git/commitdiff
change dav to support new friendica event title/summary field
authorfriendica <info@friendica.com>
Fri, 29 Jun 2012 01:18:06 +0000 (18:18 -0700)
committerfriendica <info@friendica.com>
Fri, 29 Jun 2012 01:18:06 +0000 (18:18 -0700)
dav/virtual_cal_source_friendica.inc.php

index 5123e4edd6626084646bb55cdbe0e7c8fb86555e..7434fbbc0b9337235d3ac2f9d5397e26740c936f 100644 (file)
@@ -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"]));