]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: Bookmarks doesn't federate well.
authorMichael Vogel <icarus@dabo.de>
Tue, 24 Nov 2015 20:03:06 +0000 (21:03 +0100)
committerMichael Vogel <icarus@dabo.de>
Tue, 24 Nov 2015 20:03:06 +0000 (21:03 +0100)
include/ostatus.php
include/pubsubpublish.php

index 875e1527e29103a8c19fa53531361f6256c36ed5..006a3be929afaadc725a14d70593550e63bc9651 100644 (file)
@@ -1304,8 +1304,19 @@ function ostatus_entry($doc, $item, $owner, $toplevel = false) {
                $title = sprintf("New comment by %s", $owner["nick"]);
        }
 
-       xml_add_element($doc, $entry, "activity:object-type", $item["object-type"]);
-       xml_add_element($doc, $entry, "id", $item["uri"]); //<id>tag:fresh.federati.net,2015-11-22:noticeId=324796:objectType=note</id>
+       // 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
+
+       xml_add_element($doc, $entry, "activity:object-type", ACTIVITY_OBJ_NOTE);
+       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'])
index 8ac468c313fe3f9c4c486b023dd3032b023f11b7..d27beea3d5ea7683a771afd319b54fac3abd571a 100644 (file)
@@ -18,13 +18,12 @@ function handle_pubsubhubbub() {
                $hmac_sig = hash_hmac("sha1", $params, $rr['secret']);
 
                $headers = array("Content-type: application/atom+xml",
-                                               sprintf("Link: <%s>;rel=hub," .
-                                                               "<%s>;rel=self",
-                                                               $a->get_baseurl() . '/pubsubhubbub',
-                                                               $rr['topic']),
-                                               "X-Hub-Signature: sha1=" . $hmac_sig);
+                               sprintf("Link: <%s>;rel=hub,<%s>;rel=self",
+                                       $a->get_baseurl().'/pubsubhubbub',
+                                       $rr['topic']),
+                               "X-Hub-Signature: sha1=".$hmac_sig);
 
-               logger('POST '. print_r($headers, true)."\n".$params, LOGGER_DEBUG);
+               logger('POST '.print_r($headers, true)."\n".$params, LOGGER_DEBUG);
 
                post_url($rr['callback_url'], $params, $headers);
                $ret = $a->get_curl_code();