Compare commits

...

16 Commits
6.0 ... 6.0.1

Author SHA1 Message Date
Mario
ea8d38dec0 version 6.0.1 2021-07-27 07:12:59 +00:00
Mario
0fa41f082d Merge branch 'dev' 2021-07-27 07:11:12 +00:00
Mario
83b1f62e13 more changelog 2021-07-27 07:10:43 +00:00
Mario
b19213b60b Merge branch 'dev' 2021-07-27 07:07:53 +00:00
Mario
3c5b18913f changelog 2021-07-27 07:06:22 +00:00
Mario Vavti
676a65cd61 notifications: move handlers out of jquery ready function otherwise they might not fire on pageload 2021-07-17 14:00:03 +02:00
Mario Vavti
95fb66b433 code style 2021-07-16 13:53:32 +02:00
Mario Vavti
a57529bc54 bump min version 2021-07-16 13:50:38 +02:00
Mario Vavti
4f15c08805 more work on moving notifications handling from main.js to the notifications widget 2021-07-16 13:48:35 +02:00
Mario Vavti
7b2f4b0814 fix a regression in regard to unified session page load times intoduced in 6.0 2021-07-16 12:56:57 +02:00
Mario Vavti
3051e2c268 redirect to the local item instead of the item at the primary location if we deal with a wall item 2021-07-16 12:04:31 +02:00
Mario
d7489e3913 Merge branch 'dev' into 'dev'
Fix link to source on clones

See merge request hubzilla/core!1975
2021-07-16 09:46:08 +00:00
Mario Vavti
62606bf006 photo upload: always show the textarea so that text and tags can be added even if no status post is sent 2021-07-16 11:42:54 +02:00
Max Kostikov
c68f2bc2d1 Fix link to source on clones 2021-07-16 11:12:32 +02:00
Mario Vavti
f5669c9935 chanview: dismiss xchans which are marked deleted 2021-07-15 12:07:54 +02:00
Mario Vavti
9e2bdb012e fix release date 2021-07-09 12:02:50 +02:00
11 changed files with 92 additions and 81 deletions

View File

@@ -1,3 +1,11 @@
Hubzilla 6.0.1 (2021-07-27)
- Fix regression in notification handling introduced in 6.0
- Fix regression in regard to unified session page load times introduced in 6.0
- Fix photo description textarea only available if create status post enabled
- Fix item not found by message id at clone locations
- Dismiss deleted xchans in mod chanview
Hubzilla 6.0 (2021-07-09)
- Implement swipe to right for bringing in left aside
- DB update 1247 to clean up bogus entries in updates

View File

@@ -17,19 +17,19 @@ class Chanview extends \Zotlabs\Web\Controller {
$r = null;
if($_REQUEST['hash']) {
$r = q("select * from xchan where xchan_hash = '%s'",
$r = q("select * from xchan where xchan_hash = '%s' and xchan_deleted = 0",
dbesc($_REQUEST['hash'])
);
}
if($_REQUEST['address']) {
$r = q("select * from xchan where xchan_addr = '%s'",
$r = q("select * from xchan where xchan_addr = '%s' and xchan_deleted = 0",
dbesc(punify($_REQUEST['address']))
);
}
elseif(local_channel() && intval($_REQUEST['cid'])) {
$r = q("SELECT abook.*, xchan.*
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d and abook_id = %d",
WHERE abook_channel = %d and abook_id = %d and xchan_deleted = 0",
intval(local_channel()),
intval($_REQUEST['cid'])
);
@@ -39,7 +39,7 @@ class Chanview extends \Zotlabs\Web\Controller {
// if somebody re-installed they will have more than one xchan, use the most recent name date as this is
// the most useful consistently ascending table item we have.
$r = q("select * from xchan where xchan_url = '%s' order by xchan_name_date desc",
$r = q("select * from xchan where xchan_url = '%s' and xchan_deleted = 0 order by xchan_name_date desc",
dbesc($_REQUEST['url'])
);
}
@@ -71,7 +71,7 @@ class Chanview extends \Zotlabs\Web\Controller {
if(array_path_exists('signature/signer',$zf) && $zf['signature']['signer'] === $_REQUEST['url'] && intval($zf['signature']['header_valid'])) {
Libzot::import_xchan($zf['data']);
$r = q("select * from xchan where xchan_url = '%s'",
$r = q("select * from xchan where xchan_url = '%s' and xchan_deleted = 0",
dbesc($_REQUEST['url'])
);
if($r) {
@@ -80,7 +80,7 @@ class Chanview extends \Zotlabs\Web\Controller {
}
if(! $r) {
if(discover_by_webbie($_REQUEST['url'])) {
$r = q("select * from xchan where xchan_url = '%s'",
$r = q("select * from xchan where xchan_url = '%s' and xchan_deleted = 0",
dbesc($_REQUEST['url'])
);
if($r) {

View File

@@ -280,16 +280,17 @@ class Item extends Controller {
if(argc() > 1 && argv(1) !== 'drop') {
$x = q("select uid, item_wall, llink, mid from item where mid = '%s' or mid = '%s' ",
$x = q("select uid, item_wall, llink, mid from item where mid = '%s' or mid = '%s' or uuid = '%s'",
dbesc(z_root() . '/item/' . argv(1)),
dbesc(z_root() . '/activity/' . argv(1))
dbesc(z_root() . '/activity/' . argv(1)),
dbesc(argv(1))
);
if($x) {
foreach($x as $xv) {
if (intval($xv['item_wall'])) {
$c = channelx_by_n($xv['uid']);
if ($c) {
goaway($c['xchan_url'] . '?mid=' . gen_link_id($xv['mid']));
goaway(z_root() . '/channel/' . $c['channel_address'] . '?mid=' . gen_link_id($xv['mid']));
}
}
}

View File

@@ -55,8 +55,13 @@ class Sse_bs extends Controller {
self::$xchans = ids_to_querystr($x, 'xchan_hash', true);
}
if(intval(argv(2)) > 0)
if(intval(argv(2)) > 0) {
self::$offset = argv(2);
}
else {
$_SESSION['sse_loadtime'] = datetime_convert();
}
$network = false;
$dm = false;
@@ -176,7 +181,7 @@ class Sse_bs extends Controller {
$sql_extra2
ORDER BY created DESC LIMIT $limit OFFSET $offset",
intval(self::$uid),
dbescdate($_SESSION['page_loadtime']),
dbescdate($_SESSION['sse_loadtime']),
dbesc(self::$ob_hash)
);
@@ -252,7 +257,7 @@ class Sse_bs extends Controller {
$sql_extra2
ORDER BY created DESC LIMIT $limit OFFSET $offset",
intval(self::$uid),
dbescdate($_SESSION['page_loadtime']),
dbescdate($_SESSION['sse_loadtime']),
dbesc(self::$ob_hash)
);
@@ -328,7 +333,7 @@ class Sse_bs extends Controller {
$sql_extra2
ORDER BY created DESC LIMIT $limit OFFSET $offset",
intval(self::$uid),
dbescdate($_SESSION['page_loadtime']),
dbescdate($_SESSION['sse_loadtime']),
dbesc(self::$ob_hash)
);
@@ -415,7 +420,7 @@ class Sse_bs extends Controller {
$sql_extra2
ORDER BY created DESC LIMIT $limit OFFSET $offset",
intval($sys['channel_id']),
dbescdate($_SESSION['page_loadtime']),
dbescdate($_SESSION['sse_loadtime']),
dbesc(self::$ob_hash),
dbescdate($_SESSION['static_loadtime'])
);

View File

@@ -39,8 +39,6 @@ class WebServer {
register_shutdown_function('session_write_close');
}
$_SESSION['page_loadtime'] = datetime_convert();
/**
* Language was set earlier, but we can over-ride it in the session.
* We have to do it here because the session was just now opened.

View File

@@ -13,6 +13,8 @@ class Messages {
$page = self::get_messages_page($options);
$_SESSION['messages_loadtime'] = datetime_convert();
$tpl = get_markup_template('messages_widget.tpl');
$o = replace_macros($tpl, [
'$entries' => $page['entries'],
@@ -49,7 +51,7 @@ class Messages {
$offset = intval($options['offset']);
}
$loadtime = (($offset) ? $_SESSION['page_loadtime'] : datetime_convert());
$loadtime = (($offset) ? $_SESSION['messages_loadtime'] : datetime_convert());
switch($options['type']) {
case 'direct':

View File

@@ -53,7 +53,7 @@ require_once('include/bbcode.php');
require_once('include/items.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '6.0' );
define ( 'STD_VERSION', '6.0.1' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1247 );

View File

@@ -548,8 +548,10 @@ function markRead(notifType) {
$('#nav-' + notifType + '-menu').html('');
$('#nav-' + notifType + '-sub').removeClass('show');
sessionStorage.removeItem('notification_open');
sse_setNotificationsStatus();
$(document).trigger('hz:sse_setNotificationsStatus');
});
}
function markItemRead(itemId) {
@@ -717,52 +719,18 @@ function updateConvItems(mode,data) {
}
}
// take care of the notifications count updates
var nmids = $(this).data('b64mids');
nmids.forEach(function(nmid, index) {
sse_rmids.push(nmid);
if($('.notification[data-b64mid=\'' + nmid + '\']').length) {
$('.notification[data-b64mid=\'' + nmid + '\']').each(function() {
var n = this.parentElement.id.split('-');
return sse_updateNotifications(n[1], nmid);
});
}
// special handling for forum notifications
$('.notification-forum').filter(function() {
var fmids = decodeURIComponent($(this).data('b64mids'));
var n = this.parentElement.id.split('-');
if(fmids.indexOf(nmid) > -1) {
var fcount = Number($('.' + n[1] + '-update').html());
fcount--;
$('.' + n[1] + '-update').html(fcount);
if(fcount < 1)
$('.' + n[1] + '-button').fadeOut();
var count = Number($(this).find('.badge-secondary').html());
count--;
$(this).find('.badge-secondary').html(count);
if(count < 1)
$(this).remove();
}
});
});
sse_setNotificationsStatus();
$(document).trigger('hz:sse_setNotificationsStatus', [$(this).data('b64mids')]);
});
$(window).scrollTop(scroll_position);
if(followUpPageLoad)
sse_bs_counts();
else
sse_bs_init();
if(followUpPageLoad) {
$(document).trigger('hz:sse_bs_counts');
}
else {
$(document).trigger('hz:sse_bs_init');
}
if(commentBusy) {
commentBusy = false;
@@ -902,7 +870,7 @@ function updateInit() {
liveUpdate();
}
else {
sse_bs_init();
$(document).trigger('hz:sse_bs_init');
}
if($('#live-photos').length || $('#live-cards').length || $('#live-articles').length ) {

View File

@@ -8,24 +8,11 @@ $(document).ready(function() {
UploadInit();
}
//$("#photo-edit-newtag").contact_autocomplete(baseurl + '/acl', 'a', false, function(data) {
//$("#photo-edit-newtag").val('@' + data.name);
//});
$(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
$('textarea').editor_autocomplete(baseurl+"/acl");
$('textarea').bbco_autocomplete('bbcode');
showHideBodyTextarea();
});
function showHideBodyTextarea() {
if( $('#id_visible').is(':checked'))
$('#body-textarea').slideDown();
else
$('#body-textarea').slideUp();
}
// initialize
function UploadInit() {

View File

@@ -139,6 +139,18 @@
});
$(document).on('hz:sse_setNotificationsStatus', function(e, data) {
sse_setNotificationsStatus(data);
});
$(document).on('hz:sse_bs_init', function() {
sse_bs_init();
});
$(document).on('hz:sse_bs_counts', function() {
sse_bs_counts();
});
{{foreach $notifications as $notification}}
{{if $notification.filter}}
$(document).on('click', '#tt-{{$notification.type}}-only', function(e) {
@@ -421,7 +433,7 @@
}
function sse_setNotificationsStatus() {
function sse_setNotificationsStatus(data) {
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);
@@ -458,6 +470,39 @@
$('#notifications').hide();
}
if (typeof data !== typeof undefined) {
data.forEach(function(nmid, index) {
sse_rmids.push(nmid);
if($('.notification[data-b64mid=\'' + nmid + '\']').length) {
$('.notification[data-b64mid=\'' + nmid + '\']').each(function() {
var n = this.parentElement.id.split('-');
return sse_updateNotifications(n[1], nmid);
});
}
// special handling for forum notifications
$('.notification-forum').filter(function() {
var fmids = decodeURIComponent($(this).data('b64mids'));
var n = this.parentElement.id.split('-');
if(fmids.indexOf(nmid) > -1) {
var fcount = Number($('.' + n[1] + '-update').html());
fcount--;
$('.' + n[1] + '-update').html(fcount);
if(fcount < 1)
$('.' + n[1] + '-button').fadeOut();
var count = Number($(this).find('.badge-secondary').html());
count--;
$(this).find('.badge-secondary').html(count);
if(count < 1)
$(this).remove();
}
});
});
}
}
function sse_fallback() {

View File

@@ -20,10 +20,8 @@
<input id="photos-upload-choose" type="file" name="userfile" />
</div -->
{{include file="field_input.tpl" field=$caption}}
{{include file="field_checkbox.tpl" field=$visible}}
<div id="body-textarea">
{{include file="field_textarea.tpl" field=$body}}
</div>
{{include file="field_checkbox.tpl" field=$visible}}
<div class="pull-right btn-group">
<div class="btn-group">
{{if $lockstate}}
@@ -40,10 +38,9 @@
{{if $uploader}}
{{include file="field_input.tpl" field=$caption}}
{{include file="field_checkbox.tpl" field=$visible}}
<div id="body-textarea">
{{include file="field_textarea.tpl" field=$body}}
</div>
{{include file="field_checkbox.tpl" field=$visible}}
<div id="photos-upload-perms" class="btn-group pull-right">
{{if $lockstate}}
<button class="btn btn-outline-secondary btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">