Merge branch '2014.11-develop' into 2015.11
[tine20] / tine20 / Calendar / Convert / Event / VCalendar / Factory.php
index 6a4536e..621c13a 100644 (file)
@@ -24,6 +24,7 @@ class Calendar_Convert_Event_VCalendar_Factory
     const CLIENT_THUNDERBIRD = 'thunderbird';
     const CLIENT_EMCLIENT    = 'emclient';
     const CLIENT_TINE        = 'tine';
+    const CLIENT_DAVDROID    = 'davdroid';
     
     /**
      * cache parsed user-agent strings
@@ -66,6 +67,10 @@ class Calendar_Convert_Event_VCalendar_Factory
                 return new Calendar_Convert_Event_VCalendar_EMClient($_version);
                 break;
 
+            case Calendar_Convert_Event_VCalendar_Factory::CLIENT_DAVDROID:
+                return new Calendar_Convert_Event_VCalendar_DavDroid($_version);
+                break;
+
             case Calendar_Convert_Event_VCalendar_Factory::CLIENT_TINE:
                 return new Calendar_Convert_Event_VCalendar_Tine($_version);
         }
@@ -112,6 +117,10 @@ class Calendar_Convert_Event_VCalendar_Factory
             $backend = Calendar_Convert_Event_VCalendar_Factory::CLIENT_TINE;
             $version = $matches['version'];
 
+        // DavDroid
+        } elseif (preg_match(Calendar_Convert_Event_VCalendar_DavDroid::HEADER_MATCH, $_userAgent, $matches)) {
+            $backend = Calendar_Convert_Event_VCalendar_Factory::CLIENT_TINE;
+            $version = $matches['version'];
 
         } else {
             $backend = Calendar_Convert_Event_VCalendar_Factory::CLIENT_GENERIC;