mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-22 05:15:19 +00:00
Merge branch 'dev' of /home/macgirvin/z into dev
This commit is contained in:
commit
f5878c5181
20 changed files with 37 additions and 30 deletions
|
@ -307,7 +307,7 @@ class Queue {
|
||||||
if($outq['outq_posturl'] === z_root() . '/zot') {
|
if($outq['outq_posturl'] === z_root() . '/zot') {
|
||||||
// local delivery
|
// local delivery
|
||||||
$zot = new \Zotlabs\Zot6\Receiver(new \Zotlabs\Zot6\Zot6Handler(),$outq['outq_notify']);
|
$zot = new \Zotlabs\Zot6\Receiver(new \Zotlabs\Zot6\Zot6Handler(),$outq['outq_notify']);
|
||||||
$result = $zot->run(true);
|
$result = $zot->run();
|
||||||
logger('returned_json: ' . json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), LOGGER_DATA);
|
logger('returned_json: ' . json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), LOGGER_DATA);
|
||||||
logger('deliver: local zot delivery succeeded to ' . $outq['outq_posturl']);
|
logger('deliver: local zot delivery succeeded to ' . $outq['outq_posturl']);
|
||||||
Libzot::process_response($outq['outq_posturl'],[ 'success' => true, 'body' => json_encode($result) ], $outq);
|
Libzot::process_response($outq['outq_posturl'],[ 'success' => true, 'body' => json_encode($result) ], $outq);
|
||||||
|
|
|
@ -232,7 +232,7 @@ logger('gis: ' . print_r($gis,true));
|
||||||
|
|
||||||
if ($x['partial']) {
|
if ($x['partial']) {
|
||||||
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
||||||
json_return_and_die($result);
|
json_return_and_die($x);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
||||||
|
|
|
@ -223,7 +223,7 @@ class Profile_photo {
|
||||||
|
|
||||||
if ($x['partial']) {
|
if ($x['partial']) {
|
||||||
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
||||||
json_return_and_die($result);
|
json_return_and_die($x);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
||||||
|
|
|
@ -211,7 +211,7 @@ class Cdav extends Controller {
|
||||||
$server->addPlugin(new \Sabre\CardDAV\VCFExportPlugin());
|
$server->addPlugin(new \Sabre\CardDAV\VCFExportPlugin());
|
||||||
|
|
||||||
// And off we go!
|
// And off we go!
|
||||||
$server->exec();
|
$server->start();
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ class Cloud extends Controller {
|
||||||
|
|
||||||
// All we need to do now, is to fire up the server
|
// All we need to do now, is to fire up the server
|
||||||
|
|
||||||
$server->exec();
|
$server->start();
|
||||||
|
|
||||||
if ($browser->build_page) {
|
if ($browser->build_page) {
|
||||||
construct_page();
|
construct_page();
|
||||||
|
|
|
@ -236,7 +236,7 @@ logger('gis: ' . print_r($gis,true));
|
||||||
|
|
||||||
if ($x['partial']) {
|
if ($x['partial']) {
|
||||||
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
||||||
json_return_and_die($result);
|
json_return_and_die($x);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
||||||
|
|
|
@ -126,7 +126,7 @@ class Dav extends Controller {
|
||||||
// $server->addPlugin(new \Zotlabs\Storage\QuotaPlugin($auth));
|
// $server->addPlugin(new \Zotlabs\Storage\QuotaPlugin($auth));
|
||||||
|
|
||||||
// All we need to do now, is to fire up the server
|
// All we need to do now, is to fire up the server
|
||||||
$server->exec();
|
$server->start();
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ class File_upload extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
if($x['partial']) {
|
if($x['partial']) {
|
||||||
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
||||||
json_return_and_die($result);
|
json_return_and_die($x);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
||||||
|
|
|
@ -1118,7 +1118,7 @@ class Item extends Controller {
|
||||||
|
|
||||||
|
|
||||||
$item_unseen = ((local_channel() != $profile_uid) ? 1 : 0);
|
$item_unseen = ((local_channel() != $profile_uid) ? 1 : 0);
|
||||||
$item_wall = (($post_type === 'wall' || $post_type === 'wall-comment') ? 1 : 0);
|
$item_wall = (($_REQUEST['type'] === 'wall' || $_REQUEST['type'] === 'wall-comment') ? 1 : 0);
|
||||||
$item_origin = (($origin) ? 1 : 0);
|
$item_origin = (($origin) ? 1 : 0);
|
||||||
$item_nocomment = (($nocomment) ? 1 : 0);
|
$item_nocomment = (($nocomment) ? 1 : 0);
|
||||||
|
|
||||||
|
|
|
@ -431,8 +431,8 @@ class Like extends Controller {
|
||||||
$arr['uid'] = $owner_uid;
|
$arr['uid'] = $owner_uid;
|
||||||
|
|
||||||
|
|
||||||
$arr['item_flags'] = $item_flags;
|
$arr['item_flags'] = $item['item_flags'];
|
||||||
$arr['item_wall'] = $item_wall;
|
$arr['item_wall'] = $item['item_wall'];
|
||||||
$arr['parent_mid'] = (($extended_like) ? $arr['mid'] : $item['mid']);
|
$arr['parent_mid'] = (($extended_like) ? $arr['mid'] : $item['mid']);
|
||||||
$arr['owner_xchan'] = (($extended_like) ? $ch[0]['xchan_hash'] : $thread_owner['xchan_hash']);
|
$arr['owner_xchan'] = (($extended_like) ? $ch[0]['xchan_hash'] : $thread_owner['xchan_hash']);
|
||||||
$arr['author_xchan'] = $observer['xchan_hash'];
|
$arr['author_xchan'] = $observer['xchan_hash'];
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Notifications extends \Zotlabs\Web\Controller {
|
||||||
$r = q("select count(*) as total from notify where uid = %d and seen = 0",
|
$r = q("select count(*) as total from notify where uid = %d and seen = 0",
|
||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
);
|
);
|
||||||
if($r && intval($t[0]['total']) > 49) {
|
if($r && intval($r[0]['total']) > 49) {
|
||||||
$r = q("select * from notify where uid = %d
|
$r = q("select * from notify where uid = %d
|
||||||
and seen = 0 order by created desc limit 50",
|
and seen = 0 order by created desc limit 50",
|
||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
|
@ -32,7 +32,7 @@ class Notifications extends \Zotlabs\Web\Controller {
|
||||||
$r2 = q("select * from notify where uid = %d
|
$r2 = q("select * from notify where uid = %d
|
||||||
and seen = 1 order by created desc limit %d",
|
and seen = 1 order by created desc limit %d",
|
||||||
intval(local_channel()),
|
intval(local_channel()),
|
||||||
intval(50 - intval($t[0]['total']))
|
intval(50 - intval($r[0]['total']))
|
||||||
);
|
);
|
||||||
$r = array_merge($r1,$r2);
|
$r = array_merge($r1,$r2);
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ class Notifications extends \Zotlabs\Web\Controller {
|
||||||
$notifications_available = 1;
|
$notifications_available = 1;
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$x = strip_tags(bbcode($rr['msg']));
|
$x = strip_tags(bbcode($rr['msg']));
|
||||||
$notif_content .= replace_macros(get_markup_template('notify.tpl'),array(
|
$notif_content = replace_macros(get_markup_template('notify.tpl'),array(
|
||||||
'$item_link' => z_root().'/notify/view/'. $rr['id'],
|
'$item_link' => z_root().'/notify/view/'. $rr['id'],
|
||||||
'$item_image' => $rr['photo'],
|
'$item_image' => $rr['photo'],
|
||||||
'$item_text' => $x,
|
'$item_text' => $x,
|
||||||
|
@ -52,7 +52,7 @@ class Notifications extends \Zotlabs\Web\Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$notif_content .= t('No more system notifications.');
|
$notif_content = t('No more system notifications.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$o .= replace_macros(get_markup_template('notifications.tpl'),array(
|
$o .= replace_macros(get_markup_template('notifications.tpl'),array(
|
||||||
|
|
|
@ -484,7 +484,7 @@ class Photos extends Controller {
|
||||||
|
|
||||||
if($x['partial']) {
|
if($x['partial']) {
|
||||||
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
||||||
json_return_and_die($result);
|
json_return_and_die($x);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
||||||
|
|
|
@ -260,7 +260,7 @@ class Profile_photo extends Controller {
|
||||||
|
|
||||||
if ($x['partial']) {
|
if ($x['partial']) {
|
||||||
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
||||||
json_return_and_die($result);
|
json_return_and_die($x);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
||||||
|
|
|
@ -58,7 +58,7 @@ class Wall_attach extends Controller {
|
||||||
$x = save_chunk($channel,$matches[1],$matches[2],$matches[3]);
|
$x = save_chunk($channel,$matches[1],$matches[2],$matches[3]);
|
||||||
if ($x['partial']) {
|
if ($x['partial']) {
|
||||||
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
||||||
json_return_and_die($result);
|
json_return_and_die($x);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
||||||
|
|
|
@ -160,18 +160,18 @@ class Zot6Handler implements IHandler {
|
||||||
if ($recipients) {
|
if ($recipients) {
|
||||||
// basically this means "unfriend"
|
// basically this means "unfriend"
|
||||||
foreach ($recipients as $recip) {
|
foreach ($recipients as $recip) {
|
||||||
$r = q("select channel.*,xchan.* from channel
|
$channel = q("select channel.*,xchan.* from channel
|
||||||
left join xchan on channel_hash = xchan_hash
|
left join xchan on channel_hash = xchan_hash
|
||||||
where channel_hash = '%s' limit 1",
|
where channel_hash = '%s' limit 1",
|
||||||
dbesc($recip)
|
dbesc($recip)
|
||||||
);
|
);
|
||||||
if ($r) {
|
if ($channel) {
|
||||||
$r = q("select abook_id from abook where uid = %d and abook_xchan = '%s' limit 1",
|
$abook = q("select abook_id from abook where uid = %d and abook_xchan = '%s' limit 1",
|
||||||
intval($r[0]['channel_id']),
|
intval($channel[0]['channel_id']),
|
||||||
dbesc($sender)
|
dbesc($sender)
|
||||||
);
|
);
|
||||||
if ($r) {
|
if ($abook) {
|
||||||
contact_remove($r[0]['channel_id'],$r[0]['abook_id']);
|
contact_remove($channel[0]['channel_id'],$abook[0]['abook_id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4
boot.php
4
boot.php
|
@ -16,7 +16,7 @@ use Zotlabs\Daemon\Run;
|
||||||
* @brief This file defines some global constants and includes the central App class.
|
* @brief This file defines some global constants and includes the central App class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define ( 'STD_VERSION', '21.01.09' );
|
define ( 'STD_VERSION', '21.01.20' );
|
||||||
define ( 'ZOT_REVISION', '6.0' );
|
define ( 'ZOT_REVISION', '6.0' );
|
||||||
|
|
||||||
define ( 'DB_UPDATE_VERSION', 1247 );
|
define ( 'DB_UPDATE_VERSION', 1247 );
|
||||||
|
@ -1884,7 +1884,7 @@ function proc_run() {
|
||||||
|
|
||||||
|
|
||||||
$args = array_map('escapeshellarg',$args);
|
$args = array_map('escapeshellarg',$args);
|
||||||
$cmdline = implode($args," ");
|
$cmdline = implode(' ', $args);
|
||||||
|
|
||||||
if (is_windows()) {
|
if (is_windows()) {
|
||||||
$cwd = getcwd();
|
$cwd = getcwd();
|
||||||
|
|
|
@ -200,7 +200,7 @@ function load_context_help() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
array_pop($args);
|
array_pop($args);
|
||||||
$path = implode($args,'/');
|
$path = implode('/',$args);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $context_help;
|
return $context_help;
|
||||||
|
|
|
@ -40,7 +40,7 @@ function breaklines($line, $level, $wraplength = 75)
|
||||||
$newlines[] = $line;
|
$newlines[] = $line;
|
||||||
|
|
||||||
|
|
||||||
return(implode($newlines, "\n"));
|
return(implode("\n", $newlines));
|
||||||
}
|
}
|
||||||
|
|
||||||
function quotelevel($message, $wraplength = 75)
|
function quotelevel($message, $wraplength = 75)
|
||||||
|
|
|
@ -189,6 +189,13 @@ function oembed_fetch_url($embedurl){
|
||||||
$entries = $xpath->query("//link[@type='application/json+oembed']");
|
$entries = $xpath->query("//link[@type='application/json+oembed']");
|
||||||
foreach($entries as $e){
|
foreach($entries as $e){
|
||||||
$href = $e->getAttributeNode("href")->nodeValue;
|
$href = $e->getAttributeNode("href")->nodeValue;
|
||||||
|
|
||||||
|
// Youtube will happily hand us an http oembed URL even if we specify an https link; and the returned http link will fail with a 40x if you try and fetch it
|
||||||
|
// This is not our bug, but good luck getting google to fix it.
|
||||||
|
|
||||||
|
if (strpos($href,'http:') === 0 && strpos($href,'youtu') !== false) {
|
||||||
|
$href = str_replace('http:','https:', $href);
|
||||||
|
}
|
||||||
$x = z_fetch_url($href . '&maxwidth=' . App::$videowidth);
|
$x = z_fetch_url($href . '&maxwidth=' . App::$videowidth);
|
||||||
if($x['success'])
|
if($x['success'])
|
||||||
$txt = $x['body'];
|
$txt = $x['body'];
|
||||||
|
|
|
@ -110,7 +110,7 @@ class ASNValue
|
||||||
function SetIntBuffer($Value)
|
function SetIntBuffer($Value)
|
||||||
{
|
{
|
||||||
if (strlen($Value) > 1) {
|
if (strlen($Value) > 1) {
|
||||||
$firstByte = ord($Value{0});
|
$firstByte = ord($Value[0]);
|
||||||
if ($firstByte & 0x80) { //first bit set
|
if ($firstByte & 0x80) { //first bit set
|
||||||
$Value = chr(0x00) . $Value;
|
$Value = chr(0x00) . $Value;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ class ASNValue
|
||||||
function GetIntBuffer()
|
function GetIntBuffer()
|
||||||
{
|
{
|
||||||
$result = $this->Value;
|
$result = $this->Value;
|
||||||
if (ord($result{0}) == 0x00) {
|
if (ord($result[0]) == 0x00) {
|
||||||
$result = substr($result, 1);
|
$result = substr($result, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue