Browse Source

Merge remote branch 'upstream/master'

Conflicts:
	include/bb2diaspora.php
pull/351/head
Michael Vogel 9 years ago
parent
commit
a81af2e042
40 changed files with 5539 additions and 4763 deletions
  1. +31
    -14
      boot.php
  2. +64
    -1
      include/Photo.php
  3. +10
    -1
      include/Scrape.php
  4. +26
    -12
      include/api.php
  5. +54
    -20
      include/bb2diaspora.php
  6. +2
    -2
      include/conversation.php
  7. +28
    -52
      include/diaspora.php
  8. +1
    -1
      include/enotify.php
  9. +14
    -0
      include/items.php
  10. +2
    -2
      include/nav.php
  11. +18
    -17
      include/plugin.php
  12. +11
    -1
      index.php
  13. +3
    -3
      library/simplepie/simplepie.inc
  14. +5
    -5
      mod/contacts.php
  15. +1
    -1
      mod/dfrn_poll.php
  16. +1
    -1
      mod/dfrn_request.php
  17. +2
    -2
      mod/directory.php
  18. +1
    -0
      mod/message.php
  19. +15
    -11
      mod/photos.php
  20. +2
    -2
      mod/profiles.php
  21. +12
    -15
      mod/share.php
  22. +182
    -0
      spec/zot-2012.txt
  23. +151
    -126
      util/messages.po
  24. +883
    -633
      view/de/messages.po
  25. +81
    -22
      view/de/strings.php
  26. +6
    -2
      view/photo_edit.tpl
  27. +6
    -2
      view/theme/darkzero-NS/style.css
  28. +4
    -0
      view/theme/darkzero/style.css
  29. BIN
      view/theme/dispy/dark/icons.png
  30. +9
    -9
      view/theme/dispy/dark/icons.svg
  31. +8
    -4
      view/theme/dispy/dark/style.css
  32. +1914
    -1877
      view/theme/dispy/dark/style.less
  33. +8
    -4
      view/theme/dispy/light/style.css
  34. +1914
    -1877
      view/theme/dispy/light/style.less
  35. +45
    -41
      view/theme/dispy/nav.tpl
  36. +1
    -1
      view/theme/dispy/wall_item.tpl
  37. +2
    -1
      view/theme/dispy/wallwall_item.tpl
  38. +16
    -0
      view/theme/quattro/conversation.tpl
  39. +5
    -0
      view/theme/slackr/style.css
  40. +1
    -1
      view/wallwall_item.tpl

+ 31
- 14
boot.php View File

@ -10,7 +10,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.0.1377' );
define ( 'FRIENDICA_VERSION', '3.0.1382' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1149 );
@ -77,14 +77,6 @@ define ( 'CONTACT_IS_SHARING', 2);
define ( 'CONTACT_IS_FRIEND', 3);
/**
* Hook array order
*/
define ( 'HOOK_HOOK', 0);
define ( 'HOOK_FILE', 1);
define ( 'HOOK_FUNCTION', 2);
/**
* DB update return values
*/
@ -332,6 +324,9 @@ if(! class_exists('App')) {
private $curl_code;
private $curl_headers;
private $cached_profile_image;
private $cached_profile_picdate;
function __construct() {
global $default_timezone;
@ -543,6 +538,28 @@ if(! class_exists('App')) {
return $this->curl_headers;
}
function get_cached_avatar_image($avatar_image){
if($this->cached_profile_image[$avatar_image])
return $this->cached_profile_image[$avatar_image];
$path_parts = explode("/",$avatar_image);
$common_filename = $path_parts[count($path_parts)-1];
if($this->cached_profile_picdate[$common_filename]){
$this->cached_profile_image[$avatar_image] = $avatar_image . $this->cached_profile_picdate[$common_filename];
} else {
$r = q("SELECT `contact`.`avatar-date` AS picdate FROM `contact` WHERE `contact`.`thumb` like \"%%/%s\"",
$common_filename);
if(! count($r)){
$this->cached_profile_image[$avatar_image] = $avatar_image;
} else {
$this->cached_profile_picdate[$common_filename] = "?rev=" . urlencode($r[0]['picdate']);
$this->cached_profile_image[$avatar_image] = $avatar_image . $this->cached_profile_picdate[$common_filename];
}
}
return $this->cached_profile_image[$avatar_image];
}
}
}
@ -1130,9 +1147,9 @@ if(! function_exists('profile_sidebar')) {
'fullname' => $profile['name'],
'firstname' => $firstname,
'lastname' => $lastname,
'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
'photo300' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg'),
'photo100' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg'),
'photo50' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg'),
);
if (!$block){
@ -1367,7 +1384,7 @@ if(! function_exists('proc_run')) {
if(! function_exists('current_theme')) {
function current_theme(){
$app_base_themes = array('duepuntozero', 'loozah');
$app_base_themes = array('duepuntozero', 'dispy', 'quattro');
$a = get_app();
@ -1385,7 +1402,7 @@ if(! function_exists('current_theme')) {
return($t);
}
$fallback = glob('view/theme/*/style.[css|php]');
$fallback = array_merge(glob('view/theme/*/style.css'),glob('view/theme/*/style.php'));
if(count($fallback))
return (str_replace('view/theme/','', substr($fallback[0],0,-10)));


+ 64
- 1
include/Photo.php View File

@ -121,7 +121,70 @@ class Photo {
$this->image = imagerotate($this->image,$degrees,0);
$this->width = imagesx($this->image);
$this->height = imagesy($this->image);
}
}
public function flip($horiz = true, $vert = false) {
$w = imagesx($this->image);
$h = imagesy($this->image);
$flipped = imagecreate($w, $h);
if($horiz) {
for ($x = 0; $x < $w; $x++) {
imagecopy($flipped, $this->image, $x, 0, $w - $x - 1, 0, 1, $h);
}
}
if($vert) {
for ($y = 0; $y < $h; $y++) {
imagecopy($flipped, $this->image, 0, $y, 0, $h - $y - 1, $w, 1);
}
}
$this->image = $flipped;
}
public function orient($filename) {
// based off comment on http://php.net/manual/en/function.imagerotate.php
if(! function_exists('exif_read_data'))
return;
$exif = exif_read_data($filename);
$ort = $exif['Orientation'];
switch($ort)
{
case 1: // nothing
break;
case 2: // horizontal flip
$this->flip();
break;
case 3: // 180 rotate left
$this->rotate(180);
break;
case 4: // vertical flip
$this->flip(false, true);
break;
case 5: // vertical flip + 90 rotate right
$this->flip(false, true);
$this->rotate(-90);
break;
case 6: // 90 rotate right
$this->rotate(-90);
break;
case 7: // horizontal flip + 90 rotate right
$this->flip();
$this->rotate(-90);
break;
case 8: // 90 rotate left
$this->rotate(90);
break;
}
}


+ 10
- 1
include/Scrape.php View File

@ -352,10 +352,11 @@ function probe_url($url, $mode = PROBE_NORMAL) {
$email_conversant = false;
$twitter = ((strpos($url,'twitter.com') !== false) ? true : false);
$lastfm = ((strpos($url,'last.fm/user') !== false) ? true : false);
$at_addr = ((strpos($url,'@') !== false) ? true : false);
if(! $twitter) {
if((! $twitter) && (! $lastfm)) {
if(strpos($url,'mailto:') !== false && $at_addr) {
$url = str_replace('mailto:','',$url);
@ -564,6 +565,14 @@ function probe_url($url, $mode = PROBE_NORMAL) {
$vcard['fn'] = $tid . '@twitter';
}
if($lastfm) {
$profile = $url;
$poll = str_replace(array('www.','last.fm/'),array('','ws.audioscrobbler.com/1.0/'),$url) . '/recenttracks.rss';
$vcard['nick'] = basename($url);
$vcard['fn'] = $vcard['nick'] . t(' on Last.fm');
$network = NETWORK_FEED;
}
if(! x($vcard,'fn'))
if(x($vcard,'nick'))
$vcard['fn'] = $vcard['nick'];


+ 26
- 12
include/api.php View File

@ -719,14 +719,18 @@
if ($page<0) $page=0;
$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$max_id = (x($_REQUEST,'max_id')?$_REQUEST['max_id']:0);
$exclude_replies = (x($_REQUEST,'exclude_replies')?1:0);
//$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$start = $page*$count;
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
$sql_extra = '';
if ($max_id > 0)
$sql_extra = 'AND `item`.`id` <= '.intval($max_id);
$sql_extra .= ' AND `item`.`id` <= '.intval($max_id);
if ($exclude_replies > 0)
$sql_extra .= ' AND `item`.`parent` = `item`.`id`';
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
@ -860,6 +864,8 @@
logger('API: api_statuses_show: '.$id);
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
//$sql_extra = "";
if ($_GET["conversation"] == "true") $sql_extra .= " AND `item`.`parent` = %d ORDER BY `received` ASC "; else $sql_extra .= " AND `item`.`id` = %d";
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
@ -870,19 +876,24 @@
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra
AND `item`.`id`=%d",
",
intval($id)
);
//var_dump($r);
$ret = api_format_items($r,$user_info);
$data = array('$status' => $ret[0]);
/*switch($type){
case "atom":
case "rss":
$data = api_rss_extra($a, $data, $user_info);
}*/
return api_apply_template("status", $type, $data);
//var_dump($ret);
if ($_GET["conversation"] == "true") {
$data = array('$statuses' => $ret);
return api_apply_template("timeline", $type, $data);
} else {
$data = array('$status' => $ret[0]);
/*switch($type){
case "atom":
case "rss":
$data = api_rss_extra($a, $data, $user_info);
}*/
return api_apply_template("status", $type, $data);
}
}
api_register_func('api/statuses/show','api_statuses_show', true);
@ -1061,11 +1072,14 @@
$page = (x($_REQUEST,'page')?$_REQUEST['page']-1:0);
if ($page<0) $page=0;
$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$exclude_replies = (x($_REQUEST,'exclude_replies')?1:0);
//$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$start = $page*$count;
if ($user_info['self']==1) $sql_extra = "AND `item`.`wall` = 1 ";
$sql_extra = '';
if ($user_info['self']==1) $sql_extra .= " AND `item`.`wall` = 1 ";
if ($exclude_replies > 0) $sql_extra .= ' AND `item`.`parent` = `item`.`id`';
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,


+ 54
- 20
include/bb2diaspora.php View File

@ -67,6 +67,22 @@ function stripdcode_br_cb($s) {
}
function diaspora_ul($s) {
// Replace "[\\*]" followed by any number (including zero) of
// spaces by "* " to match Diaspora's list format
return preg_replace("/\[\\\\\*\]( *)/", "* ", $s[1]);
}
function diaspora_ol($s) {
// A hack: Diaspora will create a properly-numbered ordered list even
// if you use '1.' for each element of the list, like:
// 1. First element
// 1. Second element
// 1. Third element
return preg_replace("/\[\\\\\*\]( *)/", "1. ", $s[1]);
}
function bb2diaspora($Text,$preserve_nl = false) {
@ -95,6 +111,11 @@ function bb2diaspora($Text,$preserve_nl = false) {
if($preserve_nl)
$Text = str_replace(array("\n","\r"), array('',''),$Text);
else
// Remove the "return" character, as Diaspora uses only the "newline"
// character, so having the "return" character can cause signature
// failures
$Text = str_replace("\r", "", $Text);
// Set up the parameters for a URL search string
@ -136,38 +157,45 @@ function bb2diaspora($Text,$preserve_nl = false) {
// Check for bold text
$Text = preg_replace("(\[b\](.*?)\[\/b\])is",'**$1**',$Text);
// Check for Italics text
// Check for italics text
$Text = preg_replace("(\[i\](.*?)\[\/i\])is",'_$1_',$Text);
// Check for Underline text
// $Text = preg_replace("(\[u\](.*?)\[\/u\])is",'<u>$1</u>',$Text);
// Check for underline text
// Replace with italics since Diaspora doesn't have underline
$Text = preg_replace("(\[u\](.*?)\[\/u\])is",'_$1_',$Text);
// Check for strike-through text
// $Text = preg_replace("(\[s\](.*?)\[\/s\])is",'<strike>$1</strike>',$Text);
$Text = preg_replace("(\[s\](.*?)\[\/s\])is",'**[strike]**$1**[/strike]**',$Text);
// Check for over-line text
// $Text = preg_replace("(\[o\](.*?)\[\/o\])is",'<span class="overline">$1</span>',$Text);
// Check for colored text
// $Text = preg_replace("(\[color=(.*?)\](.*?)\[\/color\])is","<span style=\"color: $1;\">$2</span>",$Text);
// Remove color since Diaspora doesn't support it
$Text = preg_replace("(\[color=(.*?)\](.*?)\[\/color\])is","$2",$Text);
// Check for sized text
// $Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])is","<span style=\"font-size: $1;\">$2</span>",$Text);
// Remove it since Diaspora doesn't support sizes very well
$Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])is","$2",$Text);
// Check for list text
// $Text = preg_replace("/\[list\](.*?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text);
// $Text = preg_replace("/\[list=1\](.*?)\[\/list\]/is", '<ul class="listdecimal">$1</ul>' ,$Text);
// $Text = preg_replace("/\[list=i\](.*?)\[\/list\]/s",'<ul class="listlowerroman">$1</ul>' ,$Text);
// $Text = preg_replace("/\[list=I\](.*?)\[\/list\]/s", '<ul class="listupperroman">$1</ul>' ,$Text);
// $Text = preg_replace("/\[list=a\](.*?)\[\/list\]/s", '<ul class="listloweralpha">$1</ul>' ,$Text);
// $Text = preg_replace("/\[list=A\](.*?)\[\/list\]/s", '<ul class="listupperalpha">$1</ul>' ,$Text);
$Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text);
$Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/is", 'diaspora_ul', $Text);
$Text = preg_replace_callback("/\[list=1\](.*?)\[\/list\]/is", 'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[list=i\](.*?)\[\/list\]/s",'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[list=I\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[list=a\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[list=A\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text);
// $Text = preg_replace("/\[li\](.*?)\[\/li\]/s", '<li>$1</li>' ,$Text);
// $Text = preg_replace("/\[td\](.*?)\[\/td\]/s", '<td>$1</td>' ,$Text);
// $Text = preg_replace("/\[tr\](.*?)\[\/tr\]/s", '<tr>$1</tr>' ,$Text);
// $Text = preg_replace("/\[table\](.*?)\[\/table\]/s", '<table>$1</table>' ,$Text);
// Just get rid of table tags since Diaspora doesn't support tables
$Text = preg_replace("/\[th\](.*?)\[\/th\]/s", '$1' ,$Text);
$Text = preg_replace("/\[td\](.*?)\[\/td\]/s", '$1' ,$Text);
$Text = preg_replace("/\[tr\](.*?)\[\/tr\]/s", '$1' ,$Text);
$Text = preg_replace("/\[table\](.*?)\[\/table\]/s", '$1' ,$Text);
// $Text = preg_replace("/\[table border=1\](.*?)\[\/table\]/s", '<table border="1" >$1</table>' ,$Text);
$Text = preg_replace("/\[table border=(.*?)\](.*?)\[\/table\]/s", '$2' ,$Text);
// $Text = preg_replace("/\[table border=0\](.*?)\[\/table\]/s", '<table border="0" >$1</table>' ,$Text);
@ -177,7 +205,7 @@ function bb2diaspora($Text,$preserve_nl = false) {
// $Text = preg_replace("(\[font=(.*?)\](.*?)\[\/font\])","<span style=\"font-family: $1;\">$2</span>",$Text);
$Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/is",'stripdcode_br_cb',$Text);
$Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/is",'stripdcode_br_cb',$Text);
// Check for [code] text
$Text = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/is","\t$2\n", $Text);
@ -189,6 +217,7 @@ function bb2diaspora($Text,$preserve_nl = false) {
// $QuoteLayout = '<blockquote>$1</blockquote>';
// Check for [quote] text
$Text = preg_replace("/\[quote\](.*?)\[\/quote\]/is",">$1\n\n", $Text);
$Text = preg_replace("/\[quote=(.*?)\](.*?)\[\/quote\]/is",">$2\n\n", $Text);
// Images
@ -203,9 +232,9 @@ function bb2diaspora($Text,$preserve_nl = false) {
// [img=widthxheight]image source[/img]
// $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/", '<img src="$3" style="height:{$2}px; width:{$1}px;" >', $Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text);
$Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", 'http://www.youtube.com/watch?v=$1', $Text);
$Text = preg_replace("/\[vimeo\]https?:\/\/player.vimeo.com\/video\/([0-9]+)(.*?)\[\/vimeo\]/ism",'http://vimeo.com/$1',$Text);
@ -235,6 +264,11 @@ function bb2diaspora($Text,$preserve_nl = false) {
$Text = preg_replace_callback('/\[(.*?)\]\((.*?)\)/ism','unescape_underscores_in_links',$Text);
*/
// Remove any leading or trailing whitespace, as this will mess up
// the Diaspora signature verification and cause the item to disappear
$Text = trim($Text);
call_hooks('bb2diaspora',$Text);
return $Text;


+ 2
- 2
include/conversation.php View File

@ -308,7 +308,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
$profile_avatar = $a->contacts[$normalised]['thumb'];
else
$profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
$profile_avatar = ((strlen($item['author-avatar'])) ? $a->get_cached_avatar_image($item['author-avatar']) : $item['thumb']);
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate);
@ -657,7 +657,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
$profile_avatar = $a->contacts[$normalised]['thumb'];
else
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb);
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb));
$like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
$dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');


+ 28
- 52
include/diaspora.php View File

@ -2162,7 +2162,7 @@ function diaspora_send_followup($item,$owner,$contact,$public_batch = false) {
$a = get_app();
$myaddr = $owner['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
$theiraddr = $contact['addr'];
// $theiraddr = $contact['addr'];
// The first item in the `item` table with the parent id is the parent. However, MySQL doesn't always
// return the items ordered by `item`.`id`, in which case the wrong item is chosen as the parent.
@ -2226,7 +2226,10 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
$a = get_app();
$myaddr = $owner['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
$theiraddr = $contact['addr'];
// $theiraddr = $contact['addr'];
$body = $item['body'];
$text = html_entity_decode(bb2diaspora($body));
// The first item in the `item` table with the parent id is the parent. However, MySQL doesn't always
@ -2245,26 +2248,30 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
$relay_retract = false;
$sql_sign_id = 'iid';
if( $item['deleted']) {
$tpl = get_markup_template('diaspora_relayable_retraction.tpl');
$relay_retract = true;
$sql_sign_id = 'retract_iid';
$target_type = ( ($item['verb'] === ACTIVITY_LIKE) ? 'Like' : 'Comment');
$sender_signed_text = $item['guid'] . ';' . $target_type ;
$sql_sign_id = 'retract_iid';
$tpl = get_markup_template('diaspora_relayable_retraction.tpl');
}
elseif($item['verb'] === ACTIVITY_LIKE) {
$tpl = get_markup_template('diaspora_like_relay.tpl');
$like = true;
$target_type = 'Post';
// $positive = (($item['deleted']) ? 'false' : 'true');
$positive = 'true';
$sender_signed_text = $item['guid'] . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $myaddr;
$tpl = get_markup_template('diaspora_like_relay.tpl');
}
else {
else { // item is a comment
$sender_signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . ';' . $myaddr;
$tpl = get_markup_template('diaspora_comment_relay.tpl');
}
$body = $item['body'];
$text = html_entity_decode(bb2diaspora($body));
// fetch the original signature if the relayable was created by a Diaspora
// or DFRN user. Relayables for other networks are not supported.
@ -2285,51 +2292,20 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
// function is called
logger('diaspora_send_relay: original author signature not found, cannot send relayable');
return;
/*
$itemcontact = q("select * from contact where `id` = %d limit 1",
intval($item['contact-id'])
);
if(count($itemcontact)) {
if(! $itemcontact[0]['self']) {
$prefix = sprintf( t('[Relayed] Comment authored by %s from network %s'),
'['. $item['author-name'] . ']' . '(' . $item['author-link'] . ')',
network_to_name($itemcontact['network'])) . "\n";
// "$body" was assigned to "$text" above. It isn't used after that, so I don't think
// the following change will do anything
$body = $prefix . $body;
// I think this comment will fail upon reaching Diaspora, because "$signed_text" is not defined
}
}
else {
// I'm confused about this "else." Since it sets "$handle = $myaddr," it seems like it should be for the case
// where the top-level post owner commented on his own post, i.e. "$itemcontact[0]['self']" is true. But it's
// positioned to be for the case where "count($itemcontact)" is 0.
$handle = $myaddr;
if($like)
$signed_text = $item['guid'] . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $handle;
elseif($relay_retract)
$signed_text = $item['guid'] . ';' . $target_type;
else
$signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . ';' . $handle;
$authorsig = base64_encode(rsa_sign($signed_text,$owner['uprvkey'],'sha256'));
q("insert into sign (`" . $sql_sign_id . "`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($item['id']),
dbesc($signed_text),
dbesc($authorsig),
dbesc($handle)
);
}
*/
}
// sign it with the top-level owner's signature
// Sign the relayable with the top-level owner's signature
//
// We'll use the $sender_signed_text that we just created, instead of the $signed_text
// stored in the database, because that provides the best chance that Diaspora will
// be able to reconstruct the signed text the same way we did. This is particularly a
// concern for the comment, whose signed text includes the text of the comment. The
// smallest change in the text of the comment, including removing whitespace, will
// make the signature verification fail. Since we translate from BB code to Diaspora's
// markup at the top of this function, which is AFTER we placed the original $signed_text
// in the database, it's hazardous to trust the original $signed_text.
$parentauthorsig = base64_encode(rsa_sign($signed_text,$owner['uprvkey'],'sha256'));
$parentauthorsig = base64_encode(rsa_sign($sender_signed_text,$owner['uprvkey'],'sha256'));
$msg = replace_macros($tpl,array(
'$guid' => xmlify($item['guid']),


+ 1
- 1
include/enotify.php View File

@ -123,7 +123,7 @@ function notification($params) {
if($params['type'] == NOTIFY_TAGSELF) {
$subject = sprintf( t('[Friendica:Notify] %s tagged you') , $params['source_name']);
$preamble = sprintf( t('%1$s tagged you at %2$s') , $params['source_name'], $sitename);
$epreamble = sprintf( t('%1$s [url=%2s]tagged you[/url].') ,
$epreamble = sprintf( t('%1$s [url=%2$s]tagged you[/url].') ,
'[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]',
$params['link']);


+ 14
- 0
include/items.php View File

@ -446,6 +446,8 @@ function get_atom_elements($feed,$item) {
$res['body'] = $purifier->purify($res['body']);
$res['body'] = @html2bbcode($res['body']);
}
elseif(! $have_real_body) {
@ -814,6 +816,12 @@ function item_store($arr,$force_parent = false) {
if($r[0]['private'])
$arr['private'] = 1;
// Edge case. We host a public forum that was originally posted to privately.
// The original author commented, but as this is a comment, the permissions
// weren't fixed up so it will still show the comment as private unless we fix it here.
if((intval($r[0]['forum_mode']) == 1) && (! $r[0]['private']))
$arr['private'] = 0;
}
else {
@ -1258,6 +1266,12 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
return 3;
}
if($contact['term-date'] != '0000-00-00 00:00:00') {
logger("dfrn_deliver: $url back from the dead - removing mark for death");
require_once('include/Contact.php');
unmark_for_death($contact);
}
$res = parse_xml_string($xml);
return $res->status;


+ 2
- 2
include/nav.php View File

@ -53,9 +53,9 @@ function nav(&$a) {
$nav['usermenu'][] = Array('notes/', t('Personal notes'), "", t('Your personal photos'));
// user info
$r = q("SELECT `micro`,`avatar-date` FROM `contact` WHERE uid=%d AND self=1", intval($a->user['uid']));
$r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid']));
$userinfo = array(
'icon' => (count($r) ? $r[0]['micro']."?rev=".urlencode($r[0]['avatar-date']): $a->get_baseurl($ssl_state)."/images/person-48.jpg"),
'icon' => (count($r) ? $a->get_cached_avatar_image($r[0]['micro']) : $a->get_baseurl($ssl_state)."/images/person-48.jpg"),
'name' => $a->user['username'],
);


+ 18
- 17
include/plugin.php View File

@ -148,7 +148,9 @@ function load_hooks() {
$r = q("SELECT * FROM `hook` WHERE 1");
if(count($r)) {
foreach($r as $rr) {
$a->hooks[] = array($rr['hook'], $rr['file'], $rr['function']);
if(! array_key_exists($rr['hook'],$a->hooks))
$a->hooks[$rr['hook']] = array();
$a->hooks[$rr['hook']][] = array($rr['file'],$rr['function']);
}
}
}}
@ -158,25 +160,24 @@ if(! function_exists('call_hooks')) {
function call_hooks($name, &$data = null) {
$a = get_app();
if(count($a->hooks)) {
foreach($a->hooks as $hook) {
if($hook[HOOK_HOOK] === $name) {
@include_once($hook[HOOK_FILE]);
if(function_exists($hook[HOOK_FUNCTION])) {
$func = $hook[HOOK_FUNCTION];
$func($a,$data);
}
else {
// remove orphan hooks
q("delete from hook where hook = '%s' and file = '$s' and function = '%s' limit 1",
dbesc($hook[HOOK_HOOK]),
dbesc($hook[HOOK_FILE]),
dbesc($hook[HOOK_FUNCTION])
);
}
if((is_array($a->hooks)) && (array_key_exists($name,$a->hooks))) {
foreach($a->hooks[$name] as $hook) {
@include_once($hook[0]);
if(function_exists($hook[1])) {
$func = $hook[1];
$func($a,$data);
}
else {
// remove orphan hooks
q("delete from hook where hook = '%s' and file = '$s' and function = '%s' limit 1",
dbesc($name),
dbesc($hook[0]),
dbesc($hook[1])
);
}
}
}
}}


+ 11
- 1
index.php View File

@ -246,7 +246,10 @@ if(! $install)
if($a->module_loaded) {
$a->page['page_title'] = $a->module;
$placeholder = '';
if(function_exists($a->module . '_init')) {
call_hooks($a->module . '_mod_init', $placeholder);
$func = $a->module . '_init';
$func($a);
}
@ -266,18 +269,25 @@ if($a->module_loaded) {
if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error)
&& (function_exists($a->module . '_post'))
&& (! x($_POST,'auth-params'))) {
call_hooks($a->module . '_mod_post', $_POST);
$func = $a->module . '_post';
$func($a);
}
if((! $a->error) && (function_exists($a->module . '_afterpost'))) {
call_hooks($a->module . '_mod_afterpost',$placeholder);
$func = $a->module . '_afterpost';
$func($a);
}
if((! $a->error) && (function_exists($a->module . '_content'))) {
$arr = array('content' => $a->page['content']);
call_hooks($a->module . '_mod_content', $arr);
$a->page['content'] = $arr['content'];
$func = $a->module . '_content';
$a->page['content'] .= $func($a);
$arr = array('content' => $func($a));
call_hooks($a->module . '_mod_aftercontent', $arr);
$a->page['content'] .= $arr['content'];
}
}


+ 3
- 3
library/simplepie/simplepie.inc View File

@ -709,7 +709,7 @@ class SimplePie
* @see SimplePie::strip_htmltags()
* @access private
*/
var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
/**
* The SimplePie class contains feed level data and options
@ -14803,7 +14803,7 @@ class SimplePie_Sanitize
// Options
var $remove_div = true;
var $image_handler = '';
var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
var $encode_instead_of_strip = false;
var $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc');
var $strip_comments = false;
@ -14892,7 +14892,7 @@ class SimplePie_Sanitize
}
}
function strip_htmltags($tags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'))
function strip_htmltags($tags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'))
{
if ($tags)
{


+ 5
- 5
mod/contacts.php View File

@ -479,12 +479,13 @@ function contacts_content(&$a) {
$searching = false;
if($search) {
$search_hdr = $search;
$search = dbesc($search.'*');
$search_txt = dbesc(protect_sprintf(preg_quote($search)));
$searching = true;
}
$sql_extra .= ((strlen($search)) ? " AND MATCH `name` AGAINST ('$search' IN BOOLEAN MODE) " : "");
$sql_extra .= (($searching) ? " AND `name` REGEXP '$search_txt' " : "");
if($nets)
$sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets));
@ -501,7 +502,6 @@ function contacts_content(&$a) {
}
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ORDER BY `name` ASC LIMIT %d , %d ",
intval($_SESSION['uid']),
intval($a->pager['start']),
@ -568,7 +568,7 @@ function contacts_content(&$a) {
'$total' => $total,
'$search' => $search_hdr,
'$desc' => t('Search your contacts'),
'$finding' => (strlen($search) ? t('Finding: ') . "'" . $search . "'" : ""),
'$finding' => (($searching) ? t('Finding: ') . "'" . $search . "'" : ""),
'$submit' => t('Find'),
'$cmd' => $a->cmd,
'$contacts' => $contacts,


+ 1
- 1
mod/dfrn_poll.php View File

@ -443,7 +443,7 @@ function dfrn_poll_content(&$a) {
$encrypted_id = '';
$id_str = $my_id . '.' . mt_rand(1000,9999);
if($r[0]['duplex'] && strlen($r[0]['pubkey'])) {
if(($r[0]['duplex'] && strlen($r[0]['pubkey'])) || (! strlen($r[0]['prvkey']))) {
openssl_public_encrypt($hash,$challenge,$r[0]['pubkey']);
openssl_public_encrypt($id_str,$encrypted_id,$r[0]['pubkey']);
}


+ 1
- 1
mod/dfrn_request.php View File

@ -170,7 +170,7 @@ function dfrn_request_post(&$a) {
info( t("Introduction complete.") . EOL);
}
$r = q("select id from contact where uid = %d and url = '%s' and `site-pubkey` = '%s limit 1",
$r = q("select id from contact where uid = %d and url = '%s' and `site-pubkey` = '%s' limit 1",
intval(local_user()),
dbesc($dfrn_url),
$parms['key'] // this was already escaped


+ 2
- 2
mod/directory.php View File

@ -73,7 +73,7 @@ function directory_content(&$a) {
$order = " ORDER BY `name` ASC ";
$r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `contact`.`avatar-date` AS picdate, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `self` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
$r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
@ -116,7 +116,7 @@ function directory_content(&$a) {
$entry = replace_macros($tpl,array(
'$id' => $rr['id'],
'$profile-link' => $profile_link,
'$photo' => $rr[$photo] . '?rev=' . urlencode($rr['picdate']),
'$photo' => $a->get_cached_avatar_image($rr[$photo]),
'$alt-text' => $rr['name'],
'$name' => $rr['name'],
'$details' => $pdesc . $details


+ 1
- 0
mod/message.php View File

@ -407,6 +407,7 @@ function message_content(&$a) {
'$parent' => $parent,
'$upload' => t('Upload photo'),
'$insert' => t('Insert web link'),
'$submit' => t('Submit'),
'$wait' => t('Please wait')
));


+ 15
- 11
mod/photos.php View File

@ -16,7 +16,7 @@ function photos_init(&$a) {
if($a->argc > 1) {
$nick = $a->argv[1];
$r = q("SELECT `user`.*, `contact`.`avatar-date` AS picdate FROM `user` LEFT JOIN `contact` on `contact`.`uid` = `user`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 LIMIT 1",
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1",
dbesc($nick)
);
@ -36,7 +36,7 @@ function photos_init(&$a) {
$o .= '<div class="vcard">';
$o .= '<div class="fn">' . $a->data['user']['username'] . '</div>';
$o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg?rev=' . urlencode($a->data['user']['picdate']) . '" alt="' . $a->data['user']['username'] . '" /></div>';
$o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg') . '" alt="' . $a->data['user']['username'] . '" /></div>';
$o .= '</div>';
if(! intval($a->data['user']['hidewall'])) {
@ -306,7 +306,8 @@ function photos_post(&$a) {
$albname = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y');
if((x($_POST,'rotate') !== false) && (intval($_POST['rotate']) == 1)) {
if((x($_POST,'rotate') !== false) &&
( (intval($_POST['rotate']) == 1) || (intval($_POST['rotate']) == 2) )) {
logger('rotate');
$r = q("select * from photo where `resource-id` = '%s' and uid = %d and scale = 0 limit 1",
@ -316,7 +317,8 @@ function photos_post(&$a) {
if(count($r)) {
$ph = new Photo($r[0]['data'], $r[0]['type']);
if($ph->is_valid()) {
$ph->rotate(270);
$rotate_deg = ( (intval($_POST['rotate']) == 1) ? 270 : 90 );
$ph->rotate($rotate_deg);
$width = $ph->getWidth();
$height = $ph->getHeight();
@ -325,8 +327,8 @@ function photos_post(&$a) {
dbesc($ph->imageString()),
intval($height),
intval($width),
dbesc($resource_id),
intval($page_owner_uid)
dbesc($resource_id),
intval($page_owner_uid)
);
if($width > 640 || $height > 640) {
@ -338,8 +340,8 @@ function photos_post(&$a) {
dbesc($ph->imageString()),
intval($height),
intval($width),
dbesc($resource_id),
intval($page_owner_uid)
dbesc($resource_id),
intval($page_owner_uid)
);
}
@ -352,8 +354,8 @@ function photos_post(&$a) {
dbesc($ph->imageString()),
intval($height),
intval($width),
dbesc($resource_id),
intval($page_owner_uid)
dbesc($resource_id),
intval($page_owner_uid)
);
}
}
@ -718,6 +720,7 @@ function photos_post(&$a) {
killme();
}
$ph->orient($src);
@unlink($src);
$width = $ph->getWidth();
@ -1250,7 +1253,8 @@ function photos_content(&$a) {
$edit_tpl = get_markup_template('photo_edit.tpl');
$edit = replace_macros($edit_tpl, array(
'$id' => $ph[0]['id'],
'$rotate' => t('Rotate CW'),
'$rotatecw' => t('Rotate CW (right)'),
'$rotateccw' => t('Rotate CCW (left)'),
'$album' => template_escape($ph[0]['album']),
'$newalbum' => t('New album name'),
'$nickname' => $a->data['user']['nickname'],


+ 2
- 2
mod/profiles.php View File

@ -635,7 +635,7 @@ function profiles_content(&$a) {
}
else {
$r = q("SELECT `profile`.*, `contact`.`avatar-date` AS picdate FROM `profile` LEFT JOIN `contact` on `contact`.`uid` = `profile`.`uid` WHERE `profile`.`uid` = %d and contact.self = 1",
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
local_user());
if(count($r)) {
@ -652,7 +652,7 @@ function profiles_content(&$a) {
foreach($r as $rr) {
$o .= replace_macros($tpl, array(
'$photo' => $rr['thumb'] . '?rev=' . urlencode($rr['picdate']),
'$photo' => $a->get_cached_avatar_image($rr['thumb']),
'$id' => $rr['id'],
'$alt' => t('Profile Image'),
'$profile_name' => $rr['profile-name'],


+ 12
- 15
mod/share.php View File

@ -8,26 +8,23 @@ function share_init(&$a) {
if((! $post_id) || (! local_user()))
killme();
$r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
intval($post_id)
$r = q("SELECT item.*, contact.network FROM `item`
left join contact on `item`.`contact-id` = `contact`.`id`
WHERE `item`.`id` = %d AND `item`.`uid` = %d LIMIT 1",
intval($post_id),
intval(local_user())
);
if(! count($r) || $r[0]['private'])
if(! count($r) || ($r[0]['private'] && ($r[0]['network'] != NETWORK_FEED)))
killme();
$o = '';
// if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) {
$o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]' . "\n";
if($r[0]['title'])
$o .= '[b]' . $r[0]['title'] . '[/b]' . "\n";
$o .= $r[0]['body'] . "\n";
// }
// else {
// $o .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
// if($r[0]['title'])
// $o .= '<strong>' . $r[0]['title'] . '</strong><br />';
// $o .= $r[0]['body'] . "\n";
// }
$o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]' . "\n";
if($r[0]['title'])
$o .= '[b]' . $r[0]['title'] . '[/b]' . "\n";
$o .= $r[0]['body'] . "\n";
echo $o;
killme();
}

+ 182
- 0
spec/zot-2012.txt View File

@ -0,0 +1,182 @@
Initial cut at Zot-2012 protocol. This is a very rough draft of some very rough ideas and concepts.
It is not yet intended to be a definitive specification and many things like the security handshakes are yet to be specified precisely.
All communications are https
First create a global unique userid
Site userid:
https://macgirvin.com/1
$guuid = base64url_encode(hash('whirlpool','https://macgirvin.com/1.' . mt_rand(1000000,9999999),1);
Then create a hashed site destination.
$gduid = base64url_encode(hash('whirlpool', $guuid . 'https://macgirvin.com',1);
These two keys will identify you as a person+site pair in the future.
You will also obtain a password upon introducing yourself to a site.
This can be used to edit locations in the future. You will always keep your global unique userid
The steps to connect with somebody are to first register your location with their site.
Then introduce yourself to the person. This contains flags for the desired relationship.
At some future time, they may confirm and adjust the relationship based on their comfort level.
Lack of confirmation is tantamount to denial.
You can set either or both of FOLLOW and SHARE which indicates the relationship from your viewpoint.
They may do likewise.
A relationship is based on you as a person and provided you register new locations with the site you can post from anywhere.
You do not need to register locations with each person, only with the site.
Introduce yourself to a site:
POST https://example.com/post
{
'type' => 'register'
'person' => $guuid
'address' => $gduid
'site' => 'https://macgirvin.com'
'info' => 'mike@macgirvin.com'
}
Returns:
{
'success' => 'true'
'pass' => me_encrypt($random_string)
}
---
Add location
---
POST https://example.com/post
{
'type' => 'location'
'person' => $guuid
'address' => $new_gduid
'site' => 'https://newsite.com'
'info' => 'mike@newsite.com'
'pass' => me_encrypt($gduid . '.' . $pass)
}
Returns:
{
'success' => 'true'
'pass' => me_encrypt($random_string)
}
---
Remove location
---
POST https://example.com/post
{
'type' => 'remove_location'
'person' => $guuid
'address' => $gduid
'pass' => me_encrypt($pass)
}
Returns:
{
'success' => 'true'
'message' => 'OK'
}
------------
Make friends
------------
This message may be reversed/repeated by the destination site to confirm.
flags is the desired friendship bits. The same message may be used with different flags
to edit or remove a relationship.
POST https://example.com/post
{
'type' => 'contact'
'person' => $gduid
'address' => $guuid
'target' => 'bobjones@example.com'
'flags' => HIDDEN=0,FOLLOW=1,SHARE=1,NOHIDDEN=1,NOFOLLOW=0,NOSHARE=0
'confirm' => me_encrypt($guuid . '.' . $pass)
}
Returns:
{
'success' => 'true'
'message' => 'OK'
'flags' => PENDING=1
}
-------
Message
-------
Passing messages is done asynchronously. This may (potentially) relieve a lot of the burden of distribution from the posting site. If you're on site 'A' and make a post, site 'A' just contacts any downstream sites and informs them that there is new content (via a $post_id). The downstream site initiates the actual data transfer.
POST https://example.com/post
{
'type' => 'post'
'person' => $guuid
'address' => $gduid
'post' => $post_id
}
Returns:
{
'success' => 'true'
'message' => 'OK'
}
--------
Callback
--------
POST https://macgirvin.com/post
{
'type' => 'retrieve'
'retrieve' => $post_id
'challenge' => you_encrypt('abc123')
'verify' => me_encrypt('xyz456' . '.' . $gduid)
}
Returns:
{
'success' => 'true'
'message' => 'OK'
'response' => 'abc123'
'data' => encrypted or raw structured post
}

+ 151
- 126
util/messages.po View File

@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 3.0.1377\n"
"Project-Id-Version: 3.0.1382\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-17 10:00-0700\n"
"POT-Creation-Date: 2012-06-22 10:00-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -36,7 +36,7 @@ msgstr ""
#: ../../mod/crepair.php:115 ../../mod/wall_attach.php:44
#: ../../mod/fsuggest.php:78 ../../mod/events.php:138 ../../mod/api.php:26
#: ../../mod/api.php:31 ../../mod/photos.php:133 ../../mod/photos.php:928
#: ../../mod/api.php:31 ../../mod/photos.php:133 ../../mod/photos.php:931
#: ../../mod/editpost.php:10 ../../mod/install.php:151
#: ../../mod/notifications.php:66 ../../mod/contacts.php:145
#: ../../mod/settings.php:106 ../../mod/settings.php:537
@ -55,8 +55,8 @@ msgstr ""
#: ../../mod/profiles.php:385 ../../mod/delegate.php:6
#: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81
#: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:507
#: ../../addon/dav/layout.fnk.php:353 ../../include/items.php:3387
#: ../../index.php:299
#: ../../addon/dav/layout.fnk.php:353 ../../include/items.php:3401
#: ../../index.php:309
msgid "Permission denied."
msgstr ""
@ -123,20 +123,21 @@ msgid "New photo from this URL"
msgstr ""
#: ../../mod/crepair.php:166 ../../mod/fsuggest.php:107
#: ../../mod/events.php:428 ../../mod/photos.php:963 ../../mod/photos.php:1021
#: ../../mod/photos.php:1266 ../../mod/photos.php:1306
#: ../../mod/photos.php:1346 ../../mod/photos.php:1377
#: ../../mod/events.php:428 ../../mod/photos.php:966 ../../mod/photos.php:1024
#: ../../mod/photos.php:1270 ../../mod/photos.php:1310
#: ../../mod/photos.php:1350 ../../mod/photos.php:1381
#: ../../mod/install.php:246 ../../mod/install.php:284
#: ../../mod/localtime.php:45 ../../mod/contacts.php:343
#: ../../mod/settings.php:555 ../../mod/settings.php:701
#: ../../mod/settings.php:762 ../../mod/settings.php:969
#: ../../mod/group.php:85 ../../mod/message.php:216 ../../mod/admin.php:420
#: ../../mod/admin.php:656 ../../mod/admin.php:792 ../../mod/admin.php:991
#: ../../mod/admin.php:1078 ../../mod/profiles.php:554
#: ../../mod/group.php:85 ../../mod/message.php:216 ../../mod/message.php:410
#: ../../mod/admin.php:420 ../../mod/admin.php:656 ../../mod/admin.php:792
#: ../../mod/admin.php:991 ../../mod/admin.php:1078 ../../mod/profiles.php:554
#: ../../mod/invite.php:119 ../../addon/facebook/facebook.php:609
#: ../../addon/snautofollow/snautofollow.php:64
#: ../../addon/yourls/yourls.php:76 ../../addon/ljpost/ljpost.php:93
#: ../../addon/nsfw/nsfw.php:57 ../../addon/planets/planets.php:158
#: ../../addon/nsfw/nsfw.php:57 ../../addon/page/page.php:164
#: ../../addon/planets/planets.php:158
#: ../../addon/uhremotestorage/uhremotestorage.php:89
#: ../../addon/randplace/randplace.php:177 ../../addon/dwpost/dwpost.php:93
#: ../../addon/drpost/drpost.php:110 ../../addon/startpage/startpage.php:92
@ -226,7 +227,7 @@ msgid "link to source"
msgstr ""
#: ../../mod/events.php:324 ../../view/theme/diabook/theme.php:131
#: ../../include/nav.php:52 ../../boot.php:1529
#: ../../include/nav.php:52 ../../boot.php:1546
msgid "Events"
msgstr ""
@ -277,7 +278,7 @@ msgid "Description:"
msgstr ""
#: ../../mod/events.php:423 ../../include/event.php:37
#: ../../include/bb2diaspora.php:265 ../../boot.php:1109
#: ../../include/bb2diaspora.php:265 ../../boot.php:1126
msgid "Location:"
msgstr ""
@ -354,19 +355,19 @@ msgstr ""
msgid "No"
msgstr ""
#: ../../mod/photos.php:44 ../../boot.php:1523
#: ../../mod/photos.php:44 ../../boot.php:1540
msgid "Photo Albums"
msgstr ""
#: ../../mod/photos.php:52 ../../mod/photos.php:154 ../../mod/photos.php:942
#: ../../mod/photos.php:1013 ../../mod/photos.php:1028
#: ../../mod/photos.php:1455 ../../mod/photos.php:1467
#: ../../mod/photos.php:52 ../../mod/photos.php:154 ../../mod/photos.php:945
#: ../../mod/photos.php:1016 ../../mod/photos.php:1031
#: ../../mod/photos.php:1459 ../../mod/photos.php:1471
#: ../../addon/communityhome/communityhome.php:110
#: ../../view/theme/diabook/theme.php:598
msgid "Contact Photos"
msgstr ""
#: ../../mod/photos.php:59 ../../mod/photos.php:1038 ../../mod/photos.php:1505
#: ../../mod/photos.php:59 ../../mod/photos.php:1041 ../../mod/photos.php:1509
msgid "Upload New Photos"
msgstr ""
@ -378,8 +379,8 @@ msgstr ""
msgid "Contact information unavailable"
msgstr ""
#: ../../mod/photos.php:154 ../../mod/photos.php:656 ../../mod/photos.php:1013
#: ../../mod/photos.php:1028 ../../mod/profile_photo.php:60
#: ../../mod/photos.php:154 ../../mod/photos.php:658 ../../mod/photos.php:1016
#: ../../mod/photos.php:1031 ../../mod/profile_photo.php:60
#: ../../mod/profile_photo.php:67 ../../mod/profile_photo.php:74
#: ../../mod/profile_photo.php:176 ../../mod/profile_photo.php:254
#: ../../mod/profile_photo.php:263
@ -393,19 +394,19 @@ msgstr ""
msgid "Album not found."
msgstr ""
#: ../../mod/photos.php:182 ../../mod/photos.php:1022
#: ../../mod/photos.php:182 ../../mod/photos.php:1025
msgid "Delete Album"
msgstr ""
#: ../../mod/photos.php:245 ../../mod/photos.php:1267
#: ../../mod/photos.php:245 ../../mod/photos.php:1271
msgid "Delete Photo"
msgstr ""
#: ../../mod/photos.php:587
#: ../../mod/photos.php:589
msgid "was tagged in a"
msgstr ""
#: ../../mod/photos.php:587 ../../mod/like.php:185 ../../mod/tagger.php:70
#: ../../mod/photos.php:589 ../../mod/like.php:185 ../../mod/tagger.php:70
#: ../../addon/communityhome/communityhome.php:163
#: ../../view/theme/diabook/theme.php:570 ../../include/text.php:1316
#: ../../include/diaspora.php:1709 ../../include/conversation.php:53
@ -413,172 +414,176 @@ msgstr ""
msgid "photo"
msgstr ""
#: ../../mod/photos.php:587
#: ../../mod/photos.php:589
msgid "by"
msgstr ""
#: ../../mod/photos.php:692 ../../addon/js_upload/js_upload.php:315
#: ../../mod/photos.php:694 ../../addon/js_upload/js_upload.php:315
msgid "Image exceeds size limit of "
msgstr ""
#: ../../mod/photos.php:700
#: ../../mod/photos.php:702
msgid "Image file is empty."
msgstr ""
#: ../../mod/photos.php:714 ../../mod/profile_photo.php:126
#: ../../mod/photos.php:716 ../../mod/profile_photo.php:126
#: ../../mod/wall_upload.php:86
msgid "Unable to process image."
msgstr ""
#: ../../mod/photos.php:734 ../../mod/profile_photo.php:259
#: ../../mod/photos.php:737 ../../mod/profile_photo.php:259
#: ../../mod/wall_upload.php:105
msgid "Image upload failed."
msgstr ""
#: ../../mod/photos.php:820 ../../mod/community.php:16
#: ../../mod/photos.php:823 ../../mod/community.php:16
#: ../../mod/dfrn_request.php:759 ../../mod/viewcontacts.php:17
#: ../../mod/display.php:7 ../../mod/search.php:71 ../../mod/directory.php:29
msgid "Public access denied."
msgstr ""
#: ../../mod/photos.php:830
#: ../../mod/photos.php:833
msgid "No photos selected"
msgstr ""
#: ../../mod/photos.php:909
#: ../../mod/photos.php:912
msgid "Access to this item is restricted."
msgstr ""
#: ../../mod/photos.php:970
#: ../../mod/photos.php:973
msgid "Upload Photos"
msgstr ""
#: ../../mod/photos.php:973 ../../mod/photos.php:1017
#: ../../mod/photos.php:976 ../../mod/photos.php:1020
msgid "New album name: "
msgstr ""
#: ../../mod/photos.php:974
#: ../../mod/photos.php:977
msgid "or existing album name: "
msgstr ""
#: ../../mod/photos.php:975
#: ../../mod/photos.php:978
msgid "Do not show a status post for this upload"
msgstr ""
#: ../../mod/photos.php:977 ../../mod/photos.php:1262
#: ../../mod/photos.php:980 ../../mod/photos.php:1266
msgid "Permissions"
msgstr ""
#: ../../mod/photos.php:1032
#: ../../mod/photos.php:1035
msgid "Edit Album"
msgstr ""
#: ../../mod/photos.php:1056 ../../mod/photos.php:1488
#: ../../mod/photos.php:1059 ../../mod/photos.php:1492
msgid "View Photo"
msgstr ""
#: ../../mod/photos.php:1091
#: ../../mod/photos.php:1094
msgid "Permission denied. Access to this item may be restricted."
msgstr ""
#: ../../mod/photos.php:1093
#: ../../mod/photos.php:1096
msgid "Photo not available"
msgstr ""
#: ../../mod/photos.php:1143
#: ../../mod/photos.php:1146
msgid "View photo"
msgstr ""
#: ../../mod/photos.php:1143
#: ../../mod/photos.php:1146
msgid "Edit photo"
msgstr ""