]> git.mxchange.org Git - friendica.git/commitdiff
Notify and alias will be fetched via OStatus
authorMichael Vogel <icarus@dabo.de>
Thu, 7 Jan 2016 23:35:46 +0000 (00:35 +0100)
committerMichael Vogel <icarus@dabo.de>
Thu, 7 Jan 2016 23:35:46 +0000 (00:35 +0100)
include/ostatus.php
mod/item.php

index c1b8233298827ccde26d96c7d20e376bf64185a1..05a1efaaa86665d6755abb14ad2d5ba95cb191d6 100644 (file)
@@ -130,6 +130,14 @@ function ostatus_fetchauthor($xpath, $context, $importer, &$contact, $onlyfetch)
        if ($r AND !$onlyfetch) {
                // Update contact data
 
+               $value = $xpath->query("atom:link[@rel='salmon']", $context)->item(0)->nodeValue;
+               if ($value != "")
+                       $contact["notify"] = $value;
+
+               $value = $xpath->evaluate('atom:author/uri/text()', $context)->item(0)->nodeValue;
+               if ($value != "")
+                       $contact["alias"] = $value;
+
                $value = $xpath->evaluate('atom:author/poco:displayName/text()', $context)->item(0)->nodeValue;
                if ($value != "")
                        $contact["name"] = $value;
@@ -169,10 +177,9 @@ function ostatus_fetchauthor($xpath, $context, $importer, &$contact, $onlyfetch)
                }
 
                // @todo: Addr
-               update_gcontact(array("url" => $contact["url"], "network" => $contact["network"],
-                               "photo" => $author["author-avatar"], "name" => $contact["name"],
-                               "nick" => $contact["nick"], "location" => $contact["location"],
-                               "about" => $contact["about"], "generation" => 2));
+               $contact["generation"] = 2;
+               $contact["photo"] = $author["author-avatar"];
+               update_gcontact($contact);
        }
 
        return($author);
index 56c5ccad95828a946bb1652470b77b931f0853f9..eba8296e708493244793be1e5b10c3bded152728 100644 (file)
@@ -1109,6 +1109,11 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
                //get the person's name
                $name = substr($tag,1);
 
+               // Sometimes the tag detection doesn't seem to work right
+               // This is some workaround
+               $nameparts = explode(" ", $name);
+               $name = $nameparts[0];
+
                // Try to detect the contact in various ways
                if ((strpos($name,'@')) || (strpos($name,'http://'))) {
                        // Is it in format @user@domain.tld or @http://domain.tld/...?
@@ -1146,8 +1151,7 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
                                                dbesc(normalise_link($probed["url"])));
                                }
                        }
-               } elseif (!$r) {
-                       $newname = str_replace('_',' ',$name);
+               } else {
                        $r = false;
                        if (strrpos($name,'+')) {
                                // Is it in format @nick+number?
@@ -1330,6 +1334,7 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
                        }
                }
 */
+
                //if there is an url for this persons profile
                if(isset($profile)) {