1
0
Fork 0

Merge remote-tracking branch 'upstream/develop' into 1501-api-speedup

This commit is contained in:
Michael Vogel 2015-02-02 22:08:40 +01:00
commit 62b32e7c93
25 changed files with 9718 additions and 8329 deletions

View file

@ -664,6 +664,12 @@ function GetProfileUsername($profile, $username, $compact = false, $getnetwork =
return($username);
}
function bb_DiasporaLinks($match) {
$a = get_app();
return "[url=".$a->get_baseurl()."/display/".$match[1]."]".$match[2]."[/url]";
}
function bb_RemovePictureLinks($match) {
$text = Cache::get($match[1]);
@ -880,6 +886,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
else
$Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism",'[url=$1]$2[/url]',$Text);
// Handle Diaspora posts
$Text = preg_replace_callback("&\[url=/posts/([^\[\]]*)\](.*)\[\/url\]&Usi", 'bb_DiasporaLinks', $Text);
// if the HTML is used to generate plain text, then don't do this search, but replace all URL of that kind to text
if (!$forplaintext)
$Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1<a href="$2" target="_blank">$2</a>', $Text);

View file

@ -589,7 +589,7 @@ function diaspora_request($importer,$xml) {
intval($importer['uid'])
);
if((count($r)) && (! $r[0]['hide-friends']) && (! $contact['hidden'])) {
if((count($r)) && (!$r[0]['hide-friends']) && (!$contact['hidden']) && intval(get_pconfig($importer['uid'],'system','post_newfriend'))) {
require_once('include/items.php');
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",

View file

@ -23,12 +23,15 @@ function notification($params) {
$site_admin = sprintf( t('%s Administrator'), $sitename);
$nickname = "";
$sender_name = $product;
$sender_name = $sitename;
$hostname = $a->get_hostname();
if(strpos($hostname,':'))
$hostname = substr($hostname,0,strpos($hostname,':'));
$sender_email = t('noreply') . '@' . $hostname;
$sender_email = $a->config['sender_email'];
if (empty($sender_email)) {
$sender_email = t('noreply') . '@' . $hostname;
}
$user = q("SELECT `nickname` FROM `user` WHERE `uid` = %d", intval($params['uid']));
if ($user)

View file

@ -2715,6 +2715,10 @@ function item_is_remote_self($contact, &$datarray) {
if ($datarray["app"] == $a->get_hostname())
return false;
// Only forward posts
if ($datarray["verb"] != ACTIVITY_POST)
return false;
if (($contact['network'] != NETWORK_FEED) AND $datarray['private'])
return false;