]> git.mxchange.org Git - friendica.git/commitdiff
Fetch the hub adress while parsing OStatus messages.
authorMichael Vogel <icarus@dabo.de>
Tue, 9 Jun 2015 21:53:53 +0000 (23:53 +0200)
committerMichael Vogel <icarus@dabo.de>
Tue, 9 Jun 2015 21:53:53 +0000 (23:53 +0200)
include/ostatus.php
include/ostatus_conversation.php

index 41499a2c3ffbe541b69ab2db930991f85bd7c02c..f57b1481724da501ddc6a8f5103c6ff7e05aa4b8 100644 (file)
@@ -84,6 +84,15 @@ function ostatus_import($xml,$importer,&$contact, &$hub) {
        $xpath->registerNamespace('ostatus', "http://ostatus.org/schema/1.0");
        $xpath->registerNamespace('statusnet', "http://status.net/schema/api/1/");
 
+       $gub = "";
+       $hub_attributes = $xpath->query("/atom:feed/atom:link[@rel='hub']")->item(0)->attributes;
+       if (is_object($hub_attributes))
+               foreach($hub_attributes AS $hub_attribute)
+                       if ($hub_attribute->name == "href") {
+                               $hub = $hub_attribute->textContent;
+                               logger("Found hub ".$hub, LOGGER_DEBUG);
+                       }
+
        $header = array();
        $header["uid"] = $importer["uid"];
        $header["network"] = NETWORK_OSTATUS;
index 9642ae1dbf6722292d9000fcf08803a5c97353df..f897a058a3eb930d620bc671c7a2be57ed569209 100644 (file)
@@ -246,7 +246,7 @@ function complete_conversation($itemid, $conversation_url, $only_add_conversatio
                $arr["author-name"] = $arr["owner-name"];
                $arr["author-link"] = $actor;
                $arr["author-avatar"] = $single_conv->actor->image->url;
-               $arr["body"] = html2bbcode($single_conv->content);
+               $arr["body"] = add_page_info_to_body(html2bbcode($single_conv->content));
 
                if (isset($single_conv->status_net->notice_info->source))
                        $arr["app"] = strip_tags($single_conv->status_net->notice_info->source);