- // To use the object-type "bookmark" we have to implement these elements:
- //
- // <activity:object-type>http://activitystrea.ms/schema/1.0/bookmark</activity:object-type>
- // <title>Historic Rocket Landing</title>
- // <summary>Nur ein Testbeitrag.</summary>
- // <link rel="related" href="https://www.youtube.com/watch?v=9pillaOxGCo"/>
- // <link rel="preview" href="https://pirati.cc/file/thumb-4526-450x338-b48c8055f0c2fed0c3f67adc234c4b99484a90c42ed3cac73dc1081a4d0a7bc1.jpg.jpg" media:width="450" media:height="338"/>
- //
- // But: it seems as if it doesn't federate well between the GS servers
- // So we just set it to "note" to be sure that it reaches their target systems
-
- if (!$repeat)
- xml_add_element($doc, $entry, "activity:object-type", ACTIVITY_OBJ_NOTE);
- else
- xml_add_element($doc, $entry, "activity:object-type", NAMESPACE_ACTIVITY_SCHEMA.'activity');
-
- xml_add_element($doc, $entry, "id", $item["uri"]);
- xml_add_element($doc, $entry, "title", $title);
-
- if($item['allow_cid'] || $item['allow_gid'] || $item['deny_cid'] || $item['deny_gid'])
- $body = fix_private_photos($item['body'],$owner['uid'],$item, 0);
- else
- $body = $item['body'];
-
- $body = ostatus_format_picture_post($body);
-
- if ($item['title'] != "")
- $body = "[b]".$item['title']."[/b]\n\n".$body;
-
- //$body = bb_remove_share_information($body);
- $body = bbcode($body, false, false, 7);
-
- xml_add_element($doc, $entry, "content", $body, array("type" => "html"));
-
- xml_add_element($doc, $entry, "link", "", array("rel" => "alternate", "type" => "text/html",
- "href" => $a->get_baseurl()."/display/".$item["guid"]));
-
- xml_add_element($doc, $entry, "status_net", "", array("notice_id" => $item["id"]));
-
- if (!$is_repeat)
- xml_add_element($doc, $entry, "activity:verb", construct_verb($item));
- else
- xml_add_element($doc, $entry, "activity:verb", ACTIVITY_SHARE);
-
- xml_add_element($doc, $entry, "published", datetime_convert("UTC","UTC",$item["created"]."+00:00",ATOM_TIME));
- xml_add_element($doc, $entry, "updated", datetime_convert("UTC","UTC",$item["edited"]."+00:00",ATOM_TIME));
-
- if ($is_repeat) {
- $repeated_owner = array();
- $repeated_owner["name"] = $repeated_item["author-name"];
- $repeated_owner["url"] = $repeated_item["author-link"];
- $repeated_owner["photo"] = $repeated_item["author-avatar"];
- $repeated_owner["nick"] = $repeated_owner["name"];
- $repeated_owner["location"] = "";
- $repeated_owner["about"] = "";
- $repeated_owner["uid"] = 0;
-
- // Fetch the missing data from the global contacts
- $r =q("SELECT * FROM `gcontact` WHERE `nurl` = '%s'", normalise_link($repeated_item["author-link"]));
- if ($r) {
- if ($r[0]["nick"] != "")
- $repeated_owner["nick"] = $r[0]["nick"];