]> git.mxchange.org Git - friendica.git/commitdiff
include diaspora mentions in personal (requires adding a Diaspora profile url because...
authorfriendica <info@friendica.com>
Tue, 6 Dec 2011 23:24:01 +0000 (15:24 -0800)
committerfriendica <info@friendica.com>
Tue, 6 Dec 2011 23:24:01 +0000 (15:24 -0800)
boot.php
include/diaspora.php
mod/network.php
mod/notifications.php

index a5904ef01e9f46a8725d97a9fd2622b7bd3c434d..1f465d1107d475d3e2e9070c0ceeb074d287f9f4 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
 require_once('include/cache.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
-define ( 'FRIENDICA_VERSION',      '2.3.1186' );
+define ( 'FRIENDICA_VERSION',      '2.3.1187' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.22'    );
 define ( 'DB_UPDATE_VERSION',      1110      );
 
@@ -311,6 +311,11 @@ class App {
                if(substr($this->cmd,0,1) === '~')
                        $this->cmd = 'profile/' . substr($this->cmd,1);
 
+               // Diaspora style profile url
+
+               if(substr($this->cmd,0,2) === 'u/')
+                       $this->cmd = 'profile/' . substr($this->cmd,2);
+
                /**
                 *
                 * Break the URL path into C style argc/argv style arguments for our
index a8fd430246dd362bd204e9502b590ace4286256e..4f0df19444071b78820ed9090d2a943c1e3b7fbc 100644 (file)
@@ -621,7 +621,16 @@ function diaspora_post($importer,$xml) {
                        }
                }
        }
-       
+
+       $cnt = preg_match_all('/@\[url=(.*?)\[\/url\]/ism',$body,$matches,PREG_SET_ORDER);
+       if($cnt) {
+               foreach($matches as $mtch) {
+                       if(strlen($str_tags))
+                               $str_tags .= ',';
+                       $str_tags .= '@[url=' . $mtch[1] . '[/url]';    
+               }
+       }
+
        $datarray['uid'] = $importer['uid'];
        $datarray['contact-id'] = $contact['id'];
        $datarray['wall'] = 0;
index 8df3f83df4473e6652e2911d83d5a5fd75de2bad..2a3db597e838a5d118adecd337860bbb2b4ae38c 100644 (file)
@@ -373,9 +373,11 @@ function network_content(&$a, $update = 0) {
                $myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
                $myurl = substr($myurl,strpos($myurl,'://')+3);
                $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
-               $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` regexp '%s' or `tag` regexp '%s' )) ",
+               $diasp_url = str_replace('/profile/','/u/',$myurl);
+               $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` regexp '%s' or `tag` regexp '%s' or tag regexp '%s' )) ",
                        dbesc($myurl . '$'),
-                       dbesc($myurl . '\\]')
+                       dbesc($myurl . '\\]'),
+                       dbesc($diasp_url . '\\]')
                );
        }
 
index 385f9d719957cb365a795615f40c5a26742b77d4..5733e6e57e5d866dd7b0f444793ef04da37fd35b 100644 (file)
@@ -297,9 +297,11 @@ function notifications_content(&$a) {
                $myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
                $myurl = substr($myurl,strpos($myurl,'://')+3);
                $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
-               $sql_extra .= sprintf(" AND ( `item`.`author-link` regexp '%s' or `item`.`tag` regexp '%s' ) ",
+               $diasp_url = str_replace('/profile/','/u/',$myurl);
+               $sql_extra .= sprintf(" AND ( `item`.`author-link` regexp '%s' or `item`.`tag` regexp '%s' or `item`.`tag` regexp '%s' ) ",
                        dbesc($myurl . '$'),
-                       dbesc($myurl . '\\]')
+                       dbesc($myurl . '\\]'),
+                       dbesc($diasp_url . '\\]')
                );