Commit 9810a304 authored by Mario's avatar Mario

Merge branch '3.2RC'

parents 2f01b59e d7a0e368
......@@ -17,12 +17,19 @@ function adultphotoflag_unload() {
unregister_hook('get_features','addon/adultphotoflag/adultphotoflag.php','adultphotoflag_get_features');
}
function adultphotoflag_get_features(&$a,&$b) {
function adultphotoflag_get_features(&$a,&$x) {
$b['tools'][] = array(
$entry = [
'adult_photo_flagging',
t('Flag Adult Photos'),
t('Provide photo edit option to hide inappropriate photos from default album view'),false);
t('Provide photo edit option to hide inappropriate photos from default album view'),
false,
get_config('feature_lock','adult_photo_flagging'),
feature_level('adult_photo_flagging',2),
];
$x['features']['general'][] = $entry;
}
This diff is collapsed.
......@@ -159,9 +159,9 @@ input.radio:focus ~ label:before {
color: gray;
}
#chess-new-form input {
margin-left: 10px;
#chess-new-form .form-check-input {
margin-left: -20px;
}
#chess-new-form button {
margin-left: 20px;
}
\ No newline at end of file
margin-left: 40px;
}
......@@ -93,7 +93,7 @@ var chess_init = function () {
$(window).resize(chess_fit_board);
setTimeout(chess_fit_board,300);
setTimeout(chess_get_history,300);
chess_timer = setTimeout(chess_update_game,300);
chess_timer = setTimeout(chess_update_game,15000);
};
var chess_update_settings = function () {
......@@ -141,6 +141,13 @@ var chess_onDragStart = function(source, piece, position, orientation) {
};
var chess_onDrop = function(source, target, piece, newPos, oldPos, orientation) {
// console.log("Source: " + source);
// console.log("Target: " + target);
// console.log("Piece: " + piece);
// console.log("New position: " + ChessBoard.objToFen(newPos));
// console.log("Old position: " + ChessBoard.objToFen(oldPos));
// console.log("Orientation: " + orientation);
// console.log("--------------------");
if(ChessBoard.objToFen(newPos) === ChessBoard.objToFen(oldPos)) {
return false;
}
......@@ -236,7 +243,7 @@ var chess_update_game = function () {
return false;
},
'json');
chess_timer = setTimeout(chess_update_game,5000);
chess_timer = setTimeout(chess_update_game,15000);
};
var chess_verify_move = function () {
......
<script>
var chess_game_id = '{{$game_id}}';
var chess_timer = null;
var chess_board = null;
var chess_viewing_history = false;
var chess_original_pos = '{{$position}}';
var chess_new_pos = [];
var chess_viewing_position = '';
var chess_viewing_mid = '';
var chess_game_ended = {{$ended}};
var chess_game = null;
var chess_game_move = null;
var chess_init_active = '{{$active}}';
var chess_history = null;
var chess_moves = null;
var chess_init = function () {
$('#'+chess_init_active).show();
$("#chess-verify-move").hide();
if($("#chess-game-" + chess_game_id).length) {
$("#chess-game-" + chess_game_id).css("font-weight","bold");
$("#chess-game-" + chess_game_id + " a").css("color", "blue");
}
$("#chess-revert").hide();
$("#expand-aside").on('click', function () {
setTimeout(chess_fit_board(),500)
});
if (chess_game_ended === 1) {
$("#chess-turn-indicator").html('Game Over');
$("#chess-resume-game").show();
} else {
$("#chess-resume-game").hide();
}
var cfg = {
//sparePieces: true,
position: '{{$position}}',
orientation: 'white',
//dropOffBoard: 'snapback',
onDragStart: false
};
chess_board = new ChessBoard('chessboard', cfg);
chess_game = new Chess(chess_original_pos);
$(window).resize(chess_fit_board);
setTimeout(chess_fit_board,300);
chess_timer = setTimeout(chess_update_game,300);
$("#position-index").on('click', function () {
chess_viewing_history = false;
chess_timer = setTimeout(chess_update_game,300);
});
$("#history-prev").on('click', function () {
showPosition('prev');
});
$("#history-next").on('click', function () {
showPosition('next');
});
};
var showPosition = function (direction) {
chess_viewing_history = true;
var currentPositionIdx = $('#position-index').html();
var currentPosition = ChessBoard.objToFen(chess_board.position());
for(var i=1; i<chess_moves.length; i++) {
if(chess_moves[i].indexOf(currentPosition) >= 0) {
switch(direction) {
case 'prev':
var deltaIdx = -1;
break;
case 'next':
if(i === chess_moves.length-1) {
var deltaIdx = 2-chess_moves.length;
} else {
var deltaIdx = 1;
}
break;
}
chess_board.position(chess_moves[i+deltaIdx]);
$("#position-index").html(i+deltaIdx);
return false;
}
}
chess_board.position(chess_moves[chess_moves.length-1]);
$("#position-index").html(chess_moves.length-1);
chess_viewing_history = true;
return false;
};
var chess_fit_board = function () {
var viewportHeight = $(window).height() - $("#chessboard").offset().top;
var leftOffset = 0;
if($(window).width() > 767) {
leftOffset = 1.1*$('#region_1').width() + $('#region_1').offset().left;
} else if ($("main").hasClass('region_1-on') ) {
$('#chessboard').css('zIndex',-100);
$('#region_1').css('background-color', 'rgba(255,255,255,0.8)');
//leftOffset = $('#region_1').width();
} else {
$('#chessboard').css('zIndex','auto');
}
$("#chessboard").offset({ left: leftOffset});
var centerRegionWidth = $('#region_2').width();
if (viewportHeight < centerRegionWidth * 1.25) {
$("#chessboard").css('width', viewportHeight / 1.25);
$("#white-player-name").css('margin-top', viewportHeight / 1.2);
$("#white-player-name").css('margin-left', 20);
$("#black-player-name").css('margin-left', 20);
} else {
$("#chessboard").css('width', centerRegionWidth * 1.0);
$("#white-player-name").css('margin-top', centerRegionWidth * 1.05);
$("#white-player-name").css('margin-left', 20);
$("#black-player-name").css('margin-left', 20);
}
chess_board.resize();
};
// only allow pieces to be dragged when the board is oriented
// in their direction
var chess_onDragStart = function(source, piece, position, orientation) {
return false;
};
var chess_update_game = function () {
if(chess_viewing_history) {
return false;
}
$.post("chess/update", {game_id: chess_game_id} ,
function(data) {
//window.console.log('update received: '+JSON.stringify(data));
if (data['status']) {
chess_game = new Chess(data['position']);
chess_board.position(data['position']);
chess_game_ended = data['ended'];
if (chess_game_ended) {
$('#chess-turn-indicator').html("Game Over");
return false;
} else {
$('.turn-indicator').hide();
$('.player-name').css('font-weight', 'normal');
$('#'+data['active']+'_name').css('font-weight', 'bold');
$('#'+data['active']).show();
}
} else {
window.console.log('Error updating: ' + data['errormsg']);
}
return false;
},
'json');
chess_timer = setTimeout(chess_update_game,15000);
chess_get_history();
};
var chess_get_history = function () {
$.post("chess/history", {game_id: chess_game_id} , function(data) {
if (data['status']) {
chess_history = data['history'];
chess_moves = [];
for(var i=0; i<chess_history.length; i++) {
var move = JSON.parse(chess_history[i]['obj']);
chess_moves.push(move['position']);
}
$("#position-index").html(chess_moves.length-1);
} else {
window.console.log('Error: ' + data['errormsg']);
}
return false;
},
'json');
}
$(document).ready(chess_init);
</script>
<h2 id='chess-turn-indicator'>
{{if $ended}}
Game Over
{{/if}}
</h2>
<div id="chess-enforce-legal-moves"></div>
<div id="history-controls" style="font-size: 1.5em;">
<span id="history-prev" class="fakelink"><i class="fa fa-arrow-left fa-3xs" aria-hidden="true"></i></span>
&nbsp;
<span id="position-index" class="fakelink"></span>
&nbsp;
<span id="history-next" class="fakelink"><i class="fa fa-arrow-right fa-3xs" aria-hidden="true"></i></span>
</div>
<div id="black-player-name">
<h2>
<span class="turn-indicator" id="{{$black_xchan_hash}}" style="display: none;">
<img src="/addon/chess/view/img/chesspieces/wikipedia/bN.png" height="40" style="padding-right: 5px;">
</span>
<span class="player-name" id="{{$black_xchan_hash}}_name">{{$blackplayer}}</span>
</h2>
</div>
<div id="chessboard" style="width: 400px; position: fixed;"></div>
<div id="white-player-name" style="margin-top: 400px;">
<h2>
<span class="turn-indicator" id="{{$white_xchan_hash}}" style="display: none;">
<img src="/addon/chess/view/img/chesspieces/wikipedia/wN.png" height="40" style="padding-right: 5px;">
</span>
<span class="player-name" id="{{$white_xchan_hash}}_name">{{$whiteplayer}}</span>
</h2>
</div>
......@@ -8,7 +8,7 @@
<hr>
<form id="chess-new-form" action="chess/{{$channel}}/new/" method="post" class="acl-form" data-form_id="chess-new-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
<h4>Choose your color. White takes the first turn. </h4>
<h4>Choose your color. White takes the first turn. Random color if left blank.</h4>
<div class="form-check form-check">
<label class="form-check-label">
<input class="form-check-input" type="radio" name="color" id="id_chess_color1" value="white"> White
......@@ -32,6 +32,14 @@
<div>
<button id="dbtn-acl" class="btn btn-sm btn-success" data-toggle="modal" data-target="#aclModal" onclick="return false;" >Choose opponent</button>
</div>
<br>
<h4>Do you want the game to be publicly visible? Leave unchecked to keep the game private between players.</h4>
<div class="form-check form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="public_visible" id="id_chess_public_visible" value="0"> Make this chess game publicly visible
</label>
</div>
<hr>
<input class="btn btn-primary" id="dbtn-submit" type="submit" name="submit" value="Create Game" />
</form>
......
......@@ -25,11 +25,29 @@ class Fetch extends \Zotlabs\Web\Controller {
$item = fetch_post_tags($item,true);
$channel = channelx_by_hash($item[0]['author_xchan']);
if(! $channel) {
// see if the content owner enabled the Diaspora forgery mechanism
$owner = channelx_by_hash($item[0]['owner_xchan']);
if(($owner) && ($item[0]['item_wall']) && ($item[0]['owner_xchan'] != $item[0]['author_xchan'])) {
if(get_pconfig($owner['channel_id'],'diaspora','sign_unsigned')) {
diaspora_share_unsigned($item[0],(($item[0]['author']) ? $item[0]['author'] : null));
$channel = $owner;
}
}
}
if(! $channel) {
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($item[0]['author_xchan'])
);
if($r) {
// We cannot serve this request - redirect if there is some small chance the author's site might provide Diaspora protocol support.
// We're taking a chance on the zot connections but at worst case they will return not found when they get the request if the channel does not
// support the Diaspora protocol.
if($r && in_array($r[0]['xchan_network'],[ 'diaspora','friendica-over-diaspora','zot' ])) {
$url = $r[0]['xchan_url'];
if(strpos($url,z_root()) === false) {
$m = parse_url($url);
......@@ -37,6 +55,13 @@ class Fetch extends \Zotlabs\Web\Controller {
. '/fetch/' . argv(1) . '/' . argv(2));
}
}
// otherwise we cannot serve this request and cannot find anybody who can
http_status_exit(404,'Not found');
}
if(! intval(get_pconfig($channel['channel_id'],'system','diaspora_allowed'))) {
http_status_exit(404,'Not found');
}
......
This diff is collapsed.
......@@ -63,8 +63,7 @@ function diaspora_init_relay() {
if(! get_config('diaspora','relay_handle')) {
if(plugin_is_installed('statistics')) {
$x = ['author' => [ 'address' => 'relay@relay.iliketoast.net', 'network' => 'diaspora' ], 'result' => false ];
$placeholder = 'placeholder';
diaspora_import_author($placeholder, $x);
diaspora_import_author($x);
if($x['result']) {
set_config('diaspora','relay_handle',$x['result']);
// Now register
......@@ -105,7 +104,13 @@ function diaspora_well_known(&$b) {
$tags = get_config('diaspora','relay_tags');
if($tags) {
$disabled = false;
$scope = 'tags';
// set diaspora.firehose if you want to receive all public diaspora relay posts
// otherwise, only import posts with tags that have been followed by your site members
if(! get_config('diaspora','firehose')) {
$scope = 'tags';
}
}
$arr = array(
......@@ -161,6 +166,8 @@ function diaspora_webfinger(&$b) {
'href' => z_root()
];
$b['result']['properties']['http://purl.org/zot/federation'] .= ',diaspora';
// Diaspora requires a salmon link.
// Use this *only* if the gnusoc plugin is not installed and enabled
......@@ -830,8 +837,6 @@ function diaspora_post_local(&$item) {
if($item['mid'] === $item['parent_mid'])
return;
if($item['created'] != $item['edited'])
return;
$meta = null;
......@@ -842,7 +847,7 @@ function diaspora_post_local(&$item) {
$meta = null;
if(activity_match($item['verb'], [ ACTIVITY_LIKE, ACTIVITY_DISLIKE ])) {
if(activity_match($item['obj_type'], [ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_ACTIVITY, ACTIVITY_OBJ_COMMENT ])){
if(activity_match($item['obj_type'], [ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_ACTIVITY, ACTIVITY_OBJ_COMMENT ])) {
$meta = [
'positive' => (($item['verb'] === ACTIVITY_LIKE) ? 'true' : 'false'),
'guid' => $item['mid'],
......@@ -859,6 +864,28 @@ function diaspora_post_local(&$item) {
}
}
}
elseif(activity_match($item['verb'], [ ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTVITY_ATTENDMAYBE ])) {
if(activity_match($item['obj_type'], [ ACTIVITY_OBJ_NOTE ])) {
$status = 'tentative';
if(activity_match($item['verb'], [ ACTIVITY_ATTEND ]))
$status = 'accepted';
if(activity_match($item['verb'], [ ACTIVITY_ATTENDNO ]))
$status = 'declined';
$rawobj = ((is_array($item['obj'])) ? $item['obj'] : json_decode($item['obj'],true));
if($rawobj) {
$ev = bb2event($rawobj);
if($ev && $ev['hash'] && defined('DIASPORA_V2')) {
$meta = [
'author' => $handle,
'guid' => $item['mid'],
'parent_guid' => $ev['hash'],
'status' => $status
];
}
}
}
}
else {
$body = bb_to_markdown($item['body'], [ 'diaspora' ]);
......@@ -871,6 +898,9 @@ function diaspora_post_local(&$item) {
if(defined('DIASPORA_V2')) {
$meta['author'] = $handle;
$meta['created_at'] = datetime_convert('UTC','UTC', $item['created'], ATOM_TIME );
if($item['edited'] > $item['created']) {
$meta['edited_at'] = datetime_convert('UTC','UTC', $item['edited'], ATOM_TIME );
}
}
else {
$meta['diaspora_handle'] = $handle;
......@@ -1042,6 +1072,8 @@ function diaspora_markdown_to_bb_init(&$s) {
// if empty link text replace with the url
$s = preg_replace("/\[\]\((.*?)\)/ism",'[$1]($1)',$s);
$s = preg_replace_callback("/\!*\[(.*?)\]\((.*?)\)/ism",'diaspora_markdown_media_cb',$s);
$s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}\+/','diaspora_md_mention_callback',$s);
$s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}/','diaspora_md_mention_callback',$s);
......@@ -1057,6 +1089,24 @@ function diaspora_markdown_to_bb_init(&$s) {
}
function diaspora_markdown_media_cb($matches) {
$audios = [ '.mp3', '.ogg', '.oga', '.m4a' ];
$videos = [ '.mp4', '.ogv', '.ogm', '.webm', '.opus' ];
foreach($audios as $aud) {
if(strpos(strtolower($matches[2]),$aud) !== false)
return '[audio]' . $matches[2] . '[/audio]';
}
foreach($videos as $vid) {
if(strpos(strtolower($matches[2]),$vid) !== false)
return '[video]' . $matches[2] . '[/video]';
}
return $matches[0];
}
function diaspora_bb_to_markdown_bb(&$x) {
if(! in_array('diaspora',$x['options']))
......@@ -1067,7 +1117,6 @@ function diaspora_bb_to_markdown_bb(&$x) {
$Text = preg_replace_callback('/\@\!?\[([zu])rl\=(\w+.*?)\](\w+.*?)\[\/([zu])rl\]/i',
'diaspora_bb_to_markdown_mention_callback', $Text);
// strip map and embed tags, as the rendering is performed in bbcode() and the resulting output
// is not compatible with Diaspora (at least in the case of openstreetmap and probably
// due to the inclusion of an html iframe)
......@@ -1184,3 +1233,32 @@ function diaspora_queue_deliver(&$b) {
}
}
}
function diaspora_create_event($ev, $author) {
require_once('include/html2plain.php');
require_once('include/markdown.php');
$ret = [];
if(! ((is_array($ev)) && count($ev)))
return null;
$ret['author'] = $author;
$ret['guid'] = $ev['event_hash'];
$ret['summary'] = html2plain($ev['summary']);
$ret['start'] = $ev['dtstart'];
if(! $ev['nofinish'])
$ret['end'] = $ev['dtend'];
if(! $ev['adjust'])
$ret['all_day'] = true;
$ret['description'] = html2markdown($ev['description'] . (($ev['location']) ? "\n\n" . $ev['location'] : ''));
if($ev['created'] !== $ev['edited'])
$ret['edited_at'] = datetime_convert('UTC','UTC',$ev['edited'], ATOM_TIME);
return $ret;
}
\ No newline at end of file
......@@ -152,6 +152,14 @@ function diaspora_dispatch($importer,$msg) {
$base = $xmlbase['participation'];
$fn = 'participation';
}
elseif($xmlbase['event']) {
$base = $xmlbase['event'];
$fn = 'event';
}
elseif($xmlbase['event_participation']) {
$base = $xmlbase['event_participation'];
$fn = 'event_participation';
}
elseif($xmlbase['account_deletion']) {
$base = $xmlbase['account_deletion'];
$fn = 'account_deletion';
......
......@@ -297,6 +297,8 @@ function diaspora_send_migration($item,$owner,$contact,$public_batch = false) {
function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
$msg = diaspora_build_status($item,$owner);
if(! $msg)
return [];
logger('diaspora_send_status: '.$owner['channel_name'].' -> '.$contact['xchan_name'].' base message: ' . $msg, LOGGER_DATA);
$slap = diaspora_prepare_outbound($msg,$owner,$contact,$owner['channel_prvkey'],$contact['xchan_pubkey'], $public_batch);
......@@ -405,12 +407,17 @@ function diaspora_send_upstream($item,$owner,$contact,$public_batch = false,$upl
$conv_like = false;
$sub_like = false;
$attendance = false;
if($uplink) {
logger('uplink not supported');
return;
}
if(activity_match($item['verb'],[ ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE ])
&& activity_match($item['obj_type'],[ ACTIVITY_OBJ_NOTE ])) {
$attendance = true;
}
if(activity_match($item['verb'],[ ACTIVITY_LIKE, ACTIVITY_DISLIKE ])
&& activity_match($item['obj_type'],[ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT ])) {
$conv_like = true;
......@@ -439,7 +446,12 @@ function diaspora_send_upstream($item,$owner,$contact,$public_batch = false,$upl
$signed_fields = get_iconfig($item,'diaspora','fields');
if($signed_fields) {
$msg = arrtoxml((($conv_like) ? 'like' : 'comment' ), $signed_fields);
if($attendance) {
$msg = arrtoxml('event_participation', $signed_fields);
}
else {
$msg = arrtoxml((($conv_like) ? 'like' : 'comment' ), $signed_fields);
}
}
else {
return;
......@@ -498,6 +510,12 @@ function diaspora_send_downstream($item,$owner,$contact,$public_batch = false) {
$conv_like = false;
$sub_like = false;
$attendance = false;
if(activity_match($item['verb'],[ ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE ])
&& activity_match($item['obj_type'],[ ACTIVITY_OBJ_NOTE ])) {
$attendance = true;
}
if(activity_match($item['verb'], [ ACTIVITY_LIKE, ACTIVITY_DISLIKE ])
&& activity_match($item['obj_type'],[ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT ])) {
......@@ -525,7 +543,12 @@ function diaspora_send_downstream($item,$owner,$contact,$public_batch = false) {
$signed_fields = get_iconfig($item,'diaspora','fields');
if($signed_fields) {
$msg = arrtoxml((($conv_like) ? 'like' : 'comment' ), $signed_fields);
if($attendance) {
$msg = arrtoxml('event_participation', $signed_fields);
}
else {
$msg = arrtoxml((($conv_like) ? 'like' : 'comment' ), $signed_fields);
}
}
else {
if($conv_like)
......@@ -748,7 +771,7 @@ function diaspora_profile_change($channel,$recip,$public_batch = false,$profile_
$dob = '1000-00-00';
if(($profile['dob']) && ($profile['dob'] != '0000-00-00'))
$dob = ((intval($profile['dob'])) ? intval($profile['dob']) : '1000') . '-' . datetime_convert('UTC','UTC',$profile['dob'],'m-d');
$dob = ((intval(substr($profile['dob'],0,4))) ? intval($profile['dob']) : '1000') . '-' . datetime_convert('UTC','UTC',$profile['dob'],'m-d');
if($dob === '1000-00-00')
$dob = '';
$gender = xmlify($profile['gender']);
......@@ -809,8 +832,8 @@ function diaspora_profile_change($channel,$recip,$public_batch = false,$profile_
}
$outmsg = arrtoxml('profile',$msg);
$slap = diaspora_prepare_outbound($outmsg,$owner,$contact,$owner['channel_prvkey'],$contact['xchan_pubkey'],$public_batch);
return(diaspora_queue($owner,$contact,$slap,$public_batch,$item['mid']));
$slap = diaspora_prepare_outbound($outmsg,$owner,$recip,$owner['channel_prvkey'],$recip['xchan_pubkey'],$public_batch);
return(diaspora_queue($owner,$recip,$slap,$public_batch,$item['mid']));
}
$tpl = get_markup_template('diaspora_profile.tpl','addon/diaspora');
......
......@@ -104,7 +104,7 @@ function diaspora_sign_fields($fields,$prvkey) {
$n[$k] = $v;
}
$s = implode($n,';');
$s = implode(';',$n);
logger('signing_string: ' . $s);
return base64_encode(rsa_sign($s,$prvkey));
......@@ -122,7 +122,7 @@ function diaspora_verify_fields($fields,$sig,$pubkey) {
$n[$k] = $v;
}
$s = implode($n,';');
$s = implode(';',$n);
logger('signing_string: ' . $s);
return rsa_verify($s,base64_decode($sig),$pubkey);
......@@ -214,21 +214,36 @@ function diaspora_build_status($item,$owner) {
$myaddr = channel_reddress($owner);
if(intval($item['id']) != intval($item['parent'])) {
if($item['mid'] !== $item['parent_mid']) {
logger('attempted to send a comment as a top-level post');
return;
return '';
}
if(($item['item_wall']) && ($item['owner_xchan'] != $item['author_xchan']) &&
get_pconfig($owner['channel_id'],'diaspora','sign_unsigned')) {
diaspora_share_unsigned($item,(($item['author']) ? $item['author'] : null));
if(($item['item_wall']) && ($item['owner_xchan'] != $item['author_xchan'])) {
if(get_pconfig($owner['channel_id'],'diaspora','sign_unsigned')) {
diaspora_share_unsigned($item,(($item['author']) ? $item['author'] : null));
}
else {
logger('cannot sign wall-to-wall post for Diaspora');
return '';
}
}
$images = array();
$title = $item['title'];
$ev = bbtoevent($item['body']);
$body = bb_to_markdown($item['body'], [ 'diaspora' ]);
$ev_obj = null;
if($ev) {
$ev_obj = diaspora_create_event($ev, $myaddr);
$body = $ev_obj['summary'];
}
$poll = '';
$public = (($item['item_private']) ? 'false' : 'true');
......@@ -236,6 +251,7 @@ function diaspora_build_status($item,$owner) {
$created = datetime_convert('UTC','UTC',$item['created'],'Y-m-d H:i:s \U\T\C');
$created_at = datetime_convert('UTC','UTC',$item['created'],ATOM_TIME);
$edited_at = datetime_convert('UTC','UTC',$item['edited'],ATOM_TIME);
if(defined('DIASPORA_V2')) {
......@@ -247,6 +263,14 @@ function diaspora_build_status($item,$owner) {
'created_at' => $created_at,
];
if($edited_at > $created_at)
$arr['edited_at'] = $edited_at;
if($ev_obj) {
$arr['event'] = $ev_obj;
}
// context specific attributes
if((! $item['item_private']) && ($ret = diaspora_is_reshare($item['body']))) {
......
This diff is collapsed.
#ace-editor {
position: relative;
width: 100%;
height: 500px;
border: 1px solid #ccc;
border-top: 0px;
}
#editor {
width: 100%;
height: 500px;
border: 1px solid #ccc;
border-top: 0px;
display: inherit;
}
#id_commitMsg_wrapper {
margin-top: 3px;
}