]> git.mxchange.org Git - friendica.git/commitdiff
OStatus: Support for events and questions
authorMichael Vogel <icarus@dabo.de>
Sun, 21 Jun 2015 20:36:24 +0000 (22:36 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 21 Jun 2015 20:36:24 +0000 (22:36 +0200)
boot.php
include/ostatus.php

index 0aa7ab634133db82b1a5aa0f075d3aa11e0329a7..193b34a60bfd1f9d44fa9e53db64fa42d37b3cf9 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -290,6 +290,7 @@ define ( 'ACTIVITY_OBJ_EVENT',   NAMESPACE_ACTIVITY_SCHEMA . 'event' );
 define ( 'ACTIVITY_OBJ_GROUP',   NAMESPACE_ACTIVITY_SCHEMA . 'group' );
 define ( 'ACTIVITY_OBJ_TAGTERM', NAMESPACE_DFRN            . '/tagterm' );
 define ( 'ACTIVITY_OBJ_PROFILE', NAMESPACE_DFRN            . '/profile' );
+define ( 'ACTIVITY_OBJ_QUESTION', 'http://activityschema.org/object/question' );
 
 /**
  * item weight for query ordering
index ab5c00a6a0f0832a8c68f39a0263e125956120ae..463ebcd30a779d07235716bbf13d4d2338a1be78 100644 (file)
@@ -191,10 +191,11 @@ function ostatus_import($xml,$importer,&$contact, &$hub) {
                $item["body"] = add_page_info_to_body(html2bbcode($xpath->query('atom:content/text()', $entry)->item(0)->nodeValue));
                $item["object-type"] = $xpath->query('activity:object-type/text()', $entry)->item(0)->nodeValue;
 
-               if ($item["object-type"] == ACTIVITY_OBJ_BOOKMARK) {
+               if (($item["object-type"] == ACTIVITY_OBJ_BOOKMARK) OR ($item["object-type"] == ACTIVITY_OBJ_EVENT)) {
                        $item["title"] = $xpath->query('atom:title/text()', $entry)->item(0)->nodeValue;
                        $item["body"] = $xpath->query('atom:summary/text()', $entry)->item(0)->nodeValue;
-               }
+               } elseif ($item["object-type"] == ACTIVITY_OBJ_QUESTION)
+                       $item["title"] = $xpath->query('atom:title/text()', $entry)->item(0)->nodeValue;
 
                $item["object"] = $xml;
                $item["verb"] = $xpath->query('activity:verb/text()', $entry)->item(0)->nodeValue;
@@ -277,6 +278,9 @@ function ostatus_import($xml,$importer,&$contact, &$hub) {
                                        switch($rel) {
                                                case "alternate":
                                                        $item["plink"] = $href;
+                                                       if (($item["object-type"] == ACTIVITY_OBJ_QUESTION) OR
+                                                               ($item["object-type"] == ACTIVITY_OBJ_EVENT))
+                                                               $item["body"] .= add_page_info($href);
                                                        break;
                                                case "ostatus:conversation":
                                                        $conversation = $href;