]> git.mxchange.org Git - friendica.git/commitdiff
status.net mentions to non-followers require the numeric profile URL, not the nicknam...
authorFriendika <info@friendika.com>
Sat, 26 Feb 2011 09:53:18 +0000 (01:53 -0800)
committerFriendika <info@friendika.com>
Sat, 26 Feb 2011 09:53:18 +0000 (01:53 -0800)
boot.php
include/salmon.php
mod/item.php
view/atom_feed.tpl

index 4a0acef936bb4e848057dd43950b8be62c775525..06cf5b7605e1cad34a6be08839520059803f7551 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1941,8 +1941,10 @@ function get_mentions($item) {
        $arr = explode(',',$item['tag']);
        foreach($arr as $x) {
                $matches = null;
-               if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches))
+               if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) {
                        $o .= "\t\t" . '<link rel="mentioned" href="' . $matches[1] . '" />' . "\r\n";
+                       $o .= "\t\t" . '<link rel="ostatus:attention" href="' . $matches[1] . '" />' . "\r\n";
+               }
        }
        return $o;
 }}
index 8a56882adb6f16ef6671b8b431cb38428e482c91..b5c21a87b5641f8636fca2f24d5d6c6ad0aa9ad0 100644 (file)
@@ -128,7 +128,8 @@ $namespaces = <<< EOT
       xmlns:dfrn="http://purl.org/macgirvin/dfrn/1.0" 
       xmlns:as="http://activitystrea.ms/spec/1.0/"
       xmlns:georss="http://www.georss.org/georss" 
-      xmlns:poco="http://portablecontacts.net/spec/1.0" >
+      xmlns:poco="http://portablecontacts.net/spec/1.0" 
+      xmlns:ostatus="http://ostatus.org/schema/1.0" >
 EOT;
 
        $slap = str_replace('<entry>',$namespaces,$slap);
index c2487435e49e172f6a246726c602029486336e6b..5989d096745422dc0cf9c238d3efd53256944a38 100644 (file)
@@ -239,6 +239,7 @@ function item_post(&$a) {
                                }
                                else {
                                        $newname = $name;
+                                       $alias = '';
                                        if(strstr($name,'_')) {
                                                $newname = str_replace('_',' ',$name);
                                                $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
@@ -257,6 +258,8 @@ function item_post(&$a) {
                                                if($r[0]['network'] === 'stat') {
                                                        $newname = $r[0]['nick'];
                                                        $stat = true;
+                                                       if($r[0]['alias'])
+                                                               $alias = $r[0]['alias'];
                                                }
                                                else
                                                        $newname = $r[0]['name'];
@@ -271,6 +274,16 @@ function item_post(&$a) {
                                        if(strlen($str_tags))
                                                $str_tags .= ',';
                                        $str_tags .= '@[url=' . $profile . ']' . $newname       . '[/url]';
+
+                                       // Status.Net seems to require the numeric ID URL in a mention if the person isn't 
+                                       // subscribed to you. But the nickname URL is OK if they are. Grrr. We'll tag both. 
+
+                                       if(strlen($alias)) {
+                                               if(strlen($str_tags))
+                                                       $str_tags .= ',';
+                                               $str_tags .= '@[url=' . $alias . ']' . $newname . '[/url]';
+                                       }
+
                                }
                        }
                }
index e59b20ab1c454f0886091213d1c8c9fd2f76cf19..686c256ed9aeb30f3d9aa622845abed6dbd19430 100644 (file)
@@ -6,7 +6,8 @@
       xmlns:dfrn="http://purl.org/macgirvin/dfrn/1.0" 
       xmlns:as="http://activitystrea.ms/spec/1.0/"
       xmlns:georss="http://www.georss.org/georss" 
-      xmlns:poco="http://portablecontacts.net/spec/1.0" > 
+      xmlns:poco="http://portablecontacts.net/spec/1.0" 
+      xmlns:ostatus="http://ostatus.org/schema/1.0" > 
 
   <id>$feed_id</id>
   <title>$feed_title</title>