aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-07-27 07:07:53 +0000
committerMario <mario@mariovavti.com>2021-07-27 07:07:53 +0000
commitb19213b60be709c8e4b72f5e4b840f00c6c32a05 (patch)
tree4f700101a9b7e9dafc1bbd30ea7bd3f5bc5e8389
parentd8ac25c35a3183b173f5dc29c25b08ed7b51a875 (diff)
parent3c5b18913fcaa19373e122eb9b70fd9f2c4881b4 (diff)
downloadvolse-hubzilla-b19213b60be709c8e4b72f5e4b840f00c6c32a05.tar.gz
volse-hubzilla-b19213b60be709c8e4b72f5e4b840f00c6c32a05.tar.bz2
volse-hubzilla-b19213b60be709c8e4b72f5e4b840f00c6c32a05.zip
Merge branch 'dev'
-rw-r--r--CHANGELOG7
-rw-r--r--Zotlabs/Module/Chanview.php12
-rw-r--r--Zotlabs/Module/Item.php7
-rw-r--r--Zotlabs/Module/Sse_bs.php15
-rw-r--r--Zotlabs/Web/WebServer.php2
-rw-r--r--Zotlabs/Widget/Messages.php4
-rw-r--r--boot.php2
-rw-r--r--view/js/main.js54
-rw-r--r--view/js/mod_photos.js13
-rw-r--r--view/tpl/notifications_widget.tpl47
-rw-r--r--view/tpl/photos_upload.tpl9
11 files changed, 91 insertions, 81 deletions
diff --git a/CHANGELOG b/CHANGELOG
index fde7d849c..7a472bb2a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,10 @@
+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 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
diff --git a/Zotlabs/Module/Chanview.php b/Zotlabs/Module/Chanview.php
index afeb2aacf..fc1146023 100644
--- a/Zotlabs/Module/Chanview.php
+++ b/Zotlabs/Module/Chanview.php
@@ -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) {
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 518352667..0e76755a8 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -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']));
}
}
}
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index ca86f4f1f..388a9ba4d 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -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'])
);
diff --git a/Zotlabs/Web/WebServer.php b/Zotlabs/Web/WebServer.php
index 685f75897..de0d5a883 100644
--- a/Zotlabs/Web/WebServer.php
+++ b/Zotlabs/Web/WebServer.php
@@ -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.
diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php
index 269d669dc..21375b08f 100644
--- a/Zotlabs/Widget/Messages.php
+++ b/Zotlabs/Widget/Messages.php
@@ -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':
diff --git a/boot.php b/boot.php
index 972e99746..c0385e98b 100644
--- a/boot.php
+++ b/boot.php
@@ -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.1.1' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1247 );
diff --git a/view/js/main.js b/view/js/main.js
index f427df8ad..9f794c2ea 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -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 ) {
diff --git a/view/js/mod_photos.js b/view/js/mod_photos.js
index 41b8ed560..1ce410a1b 100644
--- a/view/js/mod_photos.js
+++ b/view/js/mod_photos.js
@@ -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() {
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 5cbfcc214..268c2b38c 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -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() {
diff --git a/view/tpl/photos_upload.tpl b/view/tpl/photos_upload.tpl
index ea173049b..0565a0a35 100644
--- a/view/tpl/photos_upload.tpl
+++ b/view/tpl/photos_upload.tpl
@@ -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;">