mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-23 01:36:14 -04:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99bff67168 | ||
|
|
bb3caeb629 | ||
|
|
65185a70d5 | ||
|
|
6d1f34284b | ||
|
|
2cfdbbd956 | ||
|
|
5f66ad5bc5 | ||
|
|
aff11443b4 | ||
|
|
6ced7ecf89 | ||
|
|
2d467a15ba | ||
|
|
28c8229218 | ||
|
|
0bcecc4baa | ||
|
|
78e68519e8 | ||
|
|
d2b06995c7 | ||
|
|
5cbae0fb81 | ||
|
|
2ddc087512 | ||
|
|
b0fe94b4b3 |
14
CHANGELOG
14
CHANGELOG
@@ -1,4 +1,16 @@
|
||||
Hubzilla 9.2 (2024-??-??)
|
||||
Hubzilla 9.2.1 (2024-07-18)
|
||||
- Fix fatal error if gd function image{jpeg, png, webp}() does not exist for some reason
|
||||
- Add missing pdl for mod import
|
||||
- Escape queueworker json data
|
||||
- Fix missing object when repeating own posts
|
||||
- Improve display of system notifications in relation with page reloads
|
||||
- Add possibility to only display system notifications with notifications widget
|
||||
- Fix layout issue with socialauth addon
|
||||
- Save a db lookup if we have just reset notifications in sse addon
|
||||
- Fix php error if attachment was an empty string in pubcrawl addon
|
||||
|
||||
|
||||
Hubzilla 9.2 (2024-07-06)
|
||||
- Fail to import more gracefully if a channel has already been imported at some point but was deleted again
|
||||
- Use the doubleleft template by default for admin pages to work around some display issues
|
||||
- Reflect the censored state in the local xchan
|
||||
|
||||
@@ -3271,7 +3271,7 @@ class Activity {
|
||||
return $content;
|
||||
}
|
||||
|
||||
if ($act['type'] === 'Event') {
|
||||
if (isset($act['type']) && $act['type'] === 'Event') {
|
||||
$adjust = false;
|
||||
$event = [];
|
||||
$event['event_hash'] = $act['id'];
|
||||
|
||||
@@ -59,7 +59,7 @@ class QueueWorker {
|
||||
$transaction = new \DbaTransaction(\DBA::$dba);
|
||||
$r = q("INSERT INTO workerq (workerq_priority, workerq_data, workerq_uuid, workerq_cmd) VALUES (%d, '%s', '%s', '%s')",
|
||||
intval($priority),
|
||||
$workinfo_json,
|
||||
dbesc($workinfo_json),
|
||||
dbesc($uuid),
|
||||
dbesc($argv[0])
|
||||
);
|
||||
@@ -105,7 +105,7 @@ class QueueWorker {
|
||||
$transaction = new \DbaTransaction(\DBA::$dba);
|
||||
$r = q("INSERT INTO workerq (workerq_priority, workerq_data, workerq_uuid, workerq_cmd) VALUES (%d, '%s', '%s', '%s')",
|
||||
intval($priority),
|
||||
$workinfo_json,
|
||||
dbesc($workinfo_json),
|
||||
dbesc($uuid),
|
||||
dbesc($argv[0])
|
||||
);
|
||||
|
||||
@@ -83,7 +83,7 @@ class XConfig {
|
||||
return $default;
|
||||
|
||||
if(! array_key_exists($xchan, \App::$config))
|
||||
load_xconfig($xchan);
|
||||
self::Load($xchan);
|
||||
|
||||
if((! array_key_exists($family, \App::$config[$xchan])) || (! array_key_exists($key, \App::$config[$xchan][$family])))
|
||||
return $default;
|
||||
|
||||
@@ -126,7 +126,7 @@ class Channels {
|
||||
goaway(z_root() . '/admin/channels' );
|
||||
}
|
||||
|
||||
$key = (($_REQUEST['key']) ? dbesc($_REQUEST['key']) : 'channel_id');
|
||||
$key = ((isset($_REQUEST['key']) && $_REQUEST['key']) ? dbesc($_REQUEST['key']) : 'channel_id');
|
||||
$dir = 'asc';
|
||||
if(array_key_exists('dir',$_REQUEST))
|
||||
$dir = ((intval($_REQUEST['dir'])) ? 'asc' : 'desc');
|
||||
|
||||
@@ -94,6 +94,12 @@ class Share extends \Zotlabs\Web\Controller {
|
||||
else
|
||||
killme();
|
||||
|
||||
$object = Activity::fetch_item([ 'id' => $item['mid'] ]);
|
||||
|
||||
if (!$object) {
|
||||
killme();
|
||||
}
|
||||
|
||||
$arr['aid'] = $item['aid'];
|
||||
$arr['uid'] = $item['uid'];
|
||||
|
||||
@@ -121,7 +127,7 @@ class Share extends \Zotlabs\Web\Controller {
|
||||
$arr['owner_xchan'] = $item['author_xchan'];
|
||||
$arr['source_xchan'] = '';
|
||||
|
||||
$arr['obj'] = $item['obj'];
|
||||
$arr['obj'] = $object;
|
||||
$arr['obj_type'] = $item['obj_type'];
|
||||
$arr['verb'] = ACTIVITY_SHARE;
|
||||
|
||||
|
||||
@@ -31,13 +31,14 @@ class Sse extends Controller {
|
||||
|
||||
// this is important!
|
||||
session_write_close();
|
||||
ignore_user_abort(true);
|
||||
|
||||
self::$uid = local_channel();
|
||||
self::$ob_hash = get_observer_hash();
|
||||
self::$sse_id = false;
|
||||
self::$vnotify = -1;
|
||||
|
||||
if(! self::$ob_hash) {
|
||||
if (!self::$ob_hash) {
|
||||
if(session_id()) {
|
||||
self::$sse_id = true;
|
||||
self::$ob_hash = 'sse_id.' . session_id();
|
||||
@@ -55,7 +56,7 @@ class Sse extends Controller {
|
||||
|
||||
self::$sse_enabled = Config::Get('system', 'sse_enabled', 0);
|
||||
|
||||
if(self::$sse_enabled) {
|
||||
if (self::$sse_enabled) {
|
||||
|
||||
// Server Sent Events
|
||||
|
||||
@@ -73,7 +74,7 @@ class Sse extends Controller {
|
||||
$i = 0;
|
||||
}
|
||||
|
||||
if(!self::$sse_id && $i === 0) {
|
||||
if (!self::$sse_id && $i === 0) {
|
||||
// Update chat presence indication about once per minute
|
||||
$r = q("select cp_id, cp_room from chatpresence where cp_xchan = '%s' and cp_client = '%s' and cp_room = 0 limit 1",
|
||||
dbesc(self::$ob_hash),
|
||||
@@ -82,7 +83,7 @@ class Sse extends Controller {
|
||||
|
||||
$basic_presence = false;
|
||||
|
||||
if($r) {
|
||||
if ($r) {
|
||||
$basic_presence = true;
|
||||
q("update chatpresence set cp_last = '%s' where cp_id = %d",
|
||||
dbesc(datetime_convert()),
|
||||
@@ -90,7 +91,7 @@ class Sse extends Controller {
|
||||
);
|
||||
}
|
||||
|
||||
if(!$basic_presence) {
|
||||
if (!$basic_presence) {
|
||||
q("insert into chatpresence ( cp_xchan, cp_last, cp_status, cp_client)
|
||||
values( '%s', '%s', '%s', '%s' ) ",
|
||||
dbesc(self::$ob_hash),
|
||||
@@ -101,16 +102,17 @@ class Sse extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
XConfig::Load(self::$ob_hash);
|
||||
|
||||
$result = [];
|
||||
|
||||
XConfig::Load(self::$ob_hash);
|
||||
|
||||
$lock = XConfig::Get(self::$ob_hash, 'sse', 'lock');
|
||||
|
||||
if (!$lock) {
|
||||
$result = XConfig::Get(self::$ob_hash, 'sse', 'notifications', []);
|
||||
}
|
||||
|
||||
|
||||
// We do not have the local_channel in the addon.
|
||||
// Reset pubs here if the app is not installed.
|
||||
if (self::$uid && (!(self::$vnotify & VNOTIFY_PUBS) || !Apps::system_app_installed(self::$uid, 'Public Stream'))) {
|
||||
@@ -119,35 +121,38 @@ class Sse extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
if($result) {
|
||||
if ($result) {
|
||||
echo "event: notifications\n";
|
||||
echo 'data: ' . json_encode($result);
|
||||
echo "\n\n";
|
||||
|
||||
XConfig::Set(self::$ob_hash, 'sse', 'notifications', []);
|
||||
unset($result);
|
||||
}
|
||||
else {
|
||||
// if no result we will send a heartbeat to keep connected
|
||||
echo "event: heartbeat\n";
|
||||
echo 'data: {}';
|
||||
echo "\n\n";
|
||||
}
|
||||
|
||||
// always send heartbeat to detect disconnected clients
|
||||
echo "event: heartbeat\n";
|
||||
echo 'data: {}';
|
||||
echo "\n\n";
|
||||
|
||||
if(ob_get_length() > 0)
|
||||
if (ob_get_length() > 0) {
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
flush();
|
||||
|
||||
if(connection_status() != CONNECTION_NORMAL || connection_aborted()) {
|
||||
//TODO: this does not seem to be triggered
|
||||
if (connection_status() != CONNECTION_NORMAL || connection_aborted()) {
|
||||
XConfig::Set(self::$ob_hash, 'sse', 'timestamp', NULL_DATE);
|
||||
break;
|
||||
XConfig::Set(self::$ob_hash, 'sse', 'notifications', []);
|
||||
exit;
|
||||
}
|
||||
|
||||
usleep($sleep);
|
||||
|
||||
if ($result) {
|
||||
XConfig::Set(self::$ob_hash, 'sse', 'notifications', []);
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
usleep($sleep);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -160,16 +160,28 @@ class PhotoGd extends PhotoDriver {
|
||||
|
||||
case 'image/png':
|
||||
$quality = Config::Get('system', 'png_quality');
|
||||
if((! $quality) || ($quality > 9))
|
||||
|
||||
if((! $quality) || ($quality > 9)) {
|
||||
$quality = PNG_QUALITY;
|
||||
\imagepng($this->image, NULL, $quality);
|
||||
}
|
||||
|
||||
if (function_exists('imagepng')) {
|
||||
\imagepng($this->image, NULL, $quality);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'image/webp':
|
||||
$quality = Config::Get('system', 'webp_quality');
|
||||
if((! $quality) || ($quality > 100))
|
||||
|
||||
if((! $quality) || ($quality > 100)) {
|
||||
$quality = WEBP_QUALITY;
|
||||
\imagewebp($this->image, NULL, $quality);
|
||||
}
|
||||
|
||||
if (function_exists('imagewebp')) {
|
||||
\imagewebp($this->image, NULL, $quality);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'image/jpeg':
|
||||
@@ -177,9 +189,15 @@ class PhotoGd extends PhotoDriver {
|
||||
|
||||
default:
|
||||
$quality = Config::Get('system', 'jpeg_quality');
|
||||
if((! $quality) || ($quality > 100))
|
||||
|
||||
if((! $quality) || ($quality > 100)) {
|
||||
$quality = JPEG_QUALITY;
|
||||
\imagejpeg($this->image, NULL, $quality);
|
||||
}
|
||||
|
||||
if (function_exists('imagejpeg')) {
|
||||
\imagejpeg($this->image, NULL, $quality);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,8 @@ class Notifications {
|
||||
'$notifications' => $notifications,
|
||||
'$no_notifications' => t('Sorry, you have got no notifications at the moment'),
|
||||
'$loading' => t('Loading'),
|
||||
'$sys_only' => empty($arr['sys_only']) ? 0 : 1
|
||||
|
||||
]);
|
||||
|
||||
return $o;
|
||||
|
||||
28
boot.php
28
boot.php
@@ -66,7 +66,7 @@ require_once('include/security.php');
|
||||
|
||||
|
||||
define('PLATFORM_NAME', 'hubzilla');
|
||||
define('STD_VERSION', '9.2');
|
||||
define('STD_VERSION', '9.2.1');
|
||||
define('ZOT_REVISION', '6.0');
|
||||
|
||||
define('DB_UPDATE_VERSION', 1263);
|
||||
@@ -1928,19 +1928,22 @@ function notice($s) {
|
||||
}
|
||||
}
|
||||
|
||||
$x = null;
|
||||
|
||||
$t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE);
|
||||
|
||||
if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) {
|
||||
set_xconfig($hash, 'sse', 'notifications', []);
|
||||
$x = [];
|
||||
}
|
||||
|
||||
$x = get_xconfig($hash, 'sse', 'notifications');
|
||||
if ($x === null) {
|
||||
$x = get_xconfig($hash, 'sse', 'notifications', []);
|
||||
}
|
||||
|
||||
if ($x === false)
|
||||
$x = [];
|
||||
|
||||
if (isset($x['notice']) && in_array($s, $x['notice']['notifications']))
|
||||
if (isset($x['notice']) && in_array($s, $x['notice']['notifications'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (App::$interactive) {
|
||||
$x['notice']['notifications'][] = $s;
|
||||
@@ -1988,19 +1991,22 @@ function info($s) {
|
||||
}
|
||||
}
|
||||
|
||||
$x = null;
|
||||
|
||||
$t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE);
|
||||
|
||||
if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) {
|
||||
set_xconfig($hash, 'sse', 'notifications', []);
|
||||
$x = [];
|
||||
}
|
||||
|
||||
$x = get_xconfig($hash, 'sse', 'notifications');
|
||||
if ($x === null) {
|
||||
$x = get_xconfig($hash, 'sse', 'notifications', []);
|
||||
}
|
||||
|
||||
if ($x === false)
|
||||
$x = [];
|
||||
|
||||
if (isset($x['info']) && in_array($s, $x['info']['notifications']))
|
||||
if (isset($x['info']) && in_array($s, $x['info']['notifications'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (App::$interactive) {
|
||||
$x['info']['notifications'][] = $s;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[template]doubleleft[/template]
|
||||
[region=aside]
|
||||
[widget=notifications][var=sys_only]1[/var][/widget]
|
||||
[widget=admin][/widget]
|
||||
[/region]
|
||||
[region=content]
|
||||
|
||||
8
view/pdl/mod_import.pdl
Normal file
8
view/pdl/mod_import.pdl
Normal file
@@ -0,0 +1,8 @@
|
||||
[region=aside]
|
||||
[/region]
|
||||
[region=content]
|
||||
$content
|
||||
[/region]
|
||||
[region=right_aside]
|
||||
[widget=notifications][/widget]
|
||||
[/region]
|
||||
@@ -5,6 +5,7 @@
|
||||
var sse_partial_result = false;
|
||||
var sse_rmids = [];
|
||||
var sse_fallback_interval;
|
||||
var sse_sys_only = {{$sys_only}};
|
||||
|
||||
$(document).ready(function() {
|
||||
let notifications_parent;
|
||||
@@ -219,8 +220,9 @@
|
||||
}
|
||||
|
||||
function sse_bs_counts() {
|
||||
if(sse_bs_active)
|
||||
if(sse_bs_active || sse_sys_only) {
|
||||
return;
|
||||
}
|
||||
|
||||
sse_bs_active = true;
|
||||
|
||||
@@ -238,10 +240,11 @@
|
||||
|
||||
function sse_bs_notifications(e, replace, followup) {
|
||||
|
||||
if(sse_bs_active)
|
||||
if(sse_bs_active || sse_sys_only) {
|
||||
return;
|
||||
}
|
||||
|
||||
var manual = false;
|
||||
let manual = false;
|
||||
|
||||
if(typeof replace === 'undefined')
|
||||
replace = e.data.replace;
|
||||
@@ -302,9 +305,27 @@
|
||||
|
||||
function sse_handleNotifications(obj, replace, followup) {
|
||||
|
||||
var primary_notifications = ['dm', 'home', 'intros', 'register', 'notify', 'files'];
|
||||
var secondary_notifications = ['network', 'forums', 'all_events', 'pubs'];
|
||||
var all_notifications = primary_notifications.concat(secondary_notifications);
|
||||
// notice and info
|
||||
|
||||
if(obj.notice) {
|
||||
$(obj.notice.notifications).each(function() {
|
||||
toast(this, 'danger');
|
||||
});
|
||||
}
|
||||
|
||||
if(obj.info) {
|
||||
$(obj.info.notifications).each(function(){
|
||||
toast(this, 'info');
|
||||
});
|
||||
}
|
||||
|
||||
if (sse_sys_only) {
|
||||
return;
|
||||
}
|
||||
|
||||
let primary_notifications = ['dm', 'home', 'intros', 'register', 'notify', 'files'];
|
||||
let secondary_notifications = ['network', 'forums', 'all_events', 'pubs'];
|
||||
let all_notifications = primary_notifications.concat(secondary_notifications);
|
||||
|
||||
all_notifications.forEach(function(type, index) {
|
||||
if(typeof obj[type] === typeof undefined)
|
||||
@@ -312,7 +333,6 @@
|
||||
|
||||
var count = Number(obj[type].count);
|
||||
|
||||
|
||||
if(obj[type].count) {
|
||||
$('.' + type + '-button').fadeIn();
|
||||
if(replace || followup) {
|
||||
@@ -336,20 +356,6 @@
|
||||
|
||||
sse_setNotificationsStatus();
|
||||
|
||||
// notice and info
|
||||
|
||||
if(obj.notice) {
|
||||
$(obj.notice.notifications).each(function() {
|
||||
toast(this, 'danger');
|
||||
});
|
||||
}
|
||||
|
||||
if(obj.info) {
|
||||
$(obj.info.notifications).each(function(){
|
||||
toast(this, 'info');
|
||||
});
|
||||
}
|
||||
|
||||
// load more notifications if visible notifications count becomes low
|
||||
if(sse_type && sse_offset != -1 && $('#nav-' + sse_type + '-menu').children(':not(.tt-filter-active)').length < 15) {
|
||||
sse_bs_notifications(sse_type, false, true);
|
||||
@@ -533,6 +539,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{{if !$sys_only}}
|
||||
<div id="notifications_wrapper" class="mb-4">
|
||||
<div id="no_notifications" class="d-xl-none">
|
||||
{{$no_notifications}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span>
|
||||
@@ -604,3 +611,4 @@
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user