introduce item_normal_update(). the differnce to item_normal() is that we do not query for item_deleted = 0 and therefor can find deleted likes which allows us to update our unlikes on the fly if static page update is enabled
This commit is contained in:
parent
1a0cf2666a
commit
dc18440c18
@ -169,6 +169,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$item_normal = item_normal();
|
$item_normal = item_normal();
|
||||||
|
$item_normal_update = item_normal_update();
|
||||||
$sql_extra = item_permissions_sql(\App::$profile['profile_uid']);
|
$sql_extra = item_permissions_sql(\App::$profile['profile_uid']);
|
||||||
|
|
||||||
if(get_pconfig(\App::$profile['profile_uid'],'system','channel_list_mode') && (! $mid))
|
if(get_pconfig(\App::$profile['profile_uid'],'system','channel_list_mode') && (! $mid))
|
||||||
@ -198,7 +199,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
if(($update) && (! $load)) {
|
if(($update) && (! $load)) {
|
||||||
|
|
||||||
if($mid) {
|
if($mid) {
|
||||||
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
|
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal_update
|
||||||
AND item_wall = 1 $simple_update $sql_extra limit 1",
|
AND item_wall = 1 $simple_update $sql_extra limit 1",
|
||||||
dbesc($mid . '%'),
|
dbesc($mid . '%'),
|
||||||
intval(\App::$profile['profile_uid'])
|
intval(\App::$profile['profile_uid'])
|
||||||
@ -208,7 +209,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
else {
|
else {
|
||||||
$r = q("SELECT distinct parent AS item_id, created from item
|
$r = q("SELECT distinct parent AS item_id, created from item
|
||||||
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
||||||
WHERE uid = %d $item_normal
|
WHERE uid = %d $item_normal_update
|
||||||
AND item_wall = 1 $simple_update
|
AND item_wall = 1 $simple_update
|
||||||
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
|
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
$sql_extra
|
$sql_extra
|
||||||
@ -241,7 +242,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if($load || ($checkjs->disabled())) {
|
if($load || ($checkjs->disabled())) {
|
||||||
if($mid) {
|
if($mid) {
|
||||||
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
|
$r = q("SELECT distinct parent AS item_id from item where mid like '%s' and uid = %d $item_normal
|
||||||
AND item_wall = 1 $sql_extra limit 1",
|
AND item_wall = 1 $sql_extra limit 1",
|
||||||
dbesc($mid . '%'),
|
dbesc($mid . '%'),
|
||||||
intval(\App::$profile['profile_uid'])
|
intval(\App::$profile['profile_uid'])
|
||||||
|
@ -185,6 +185,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$observer_hash = get_observer_hash();
|
$observer_hash = get_observer_hash();
|
||||||
$item_normal = item_normal();
|
$item_normal = item_normal();
|
||||||
|
$item_normal_update = item_normal_update();
|
||||||
|
|
||||||
$sql_extra = public_permissions_sql($observer_hash);
|
$sql_extra = public_permissions_sql($observer_hash);
|
||||||
|
|
||||||
@ -251,7 +252,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
$r = q("SELECT item.parent AS item_id from item
|
$r = q("SELECT item.parent AS item_id from item
|
||||||
WHERE uid = %d
|
WHERE uid = %d
|
||||||
and parent_mid = '%s'
|
and parent_mid = '%s'
|
||||||
$item_normal
|
$item_normal_update
|
||||||
$simple_update
|
$simple_update
|
||||||
limit 1",
|
limit 1",
|
||||||
intval(local_channel()),
|
intval(local_channel()),
|
||||||
@ -275,7 +276,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
|
and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
|
||||||
OR uid = %d )
|
OR uid = %d )
|
||||||
$sql_extra )
|
$sql_extra )
|
||||||
$item_normal
|
$item_normal_update
|
||||||
$simple_update
|
$simple_update
|
||||||
limit 1",
|
limit 1",
|
||||||
dbesc($target_item['parent_mid']),
|
dbesc($target_item['parent_mid']),
|
||||||
|
@ -44,6 +44,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$channel = \App::get_channel();
|
$channel = \App::get_channel();
|
||||||
$item_normal = item_normal();
|
$item_normal = item_normal();
|
||||||
|
$item_normal_update = item_normal_update();
|
||||||
|
|
||||||
$datequery = $datequery2 = '';
|
$datequery = $datequery2 = '';
|
||||||
|
|
||||||
@ -480,7 +481,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
// this is an update
|
// this is an update
|
||||||
$r = q("SELECT item.parent AS item_id FROM item
|
$r = q("SELECT item.parent AS item_id FROM item
|
||||||
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
||||||
WHERE true $uids $item_normal $simple_update
|
WHERE true $uids $item_normal_update $simple_update
|
||||||
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
$sql_extra3 $sql_extra $sql_nets "
|
$sql_extra3 $sql_extra $sql_nets "
|
||||||
);
|
);
|
||||||
|
@ -21,6 +21,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
$item_normal = item_normal();
|
$item_normal = item_normal();
|
||||||
|
$item_normal_update = item_normal_update();
|
||||||
|
|
||||||
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
|
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
|
||||||
|
|
||||||
@ -134,7 +135,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
|
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
|
||||||
left join abook on item.author_xchan = abook.abook_xchan
|
left join abook on item.author_xchan = abook.abook_xchan
|
||||||
WHERE true $uids $item_normal
|
WHERE true $uids $item_normal_update
|
||||||
AND item.parent = item.id $simple_update
|
AND item.parent = item.id $simple_update
|
||||||
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
$sql_extra3 $sql_extra $sql_nets"
|
$sql_extra3 $sql_extra $sql_nets"
|
||||||
|
@ -182,6 +182,12 @@ function item_normal_search() {
|
|||||||
and item.item_blocked = 0 ";
|
and item.item_blocked = 0 ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function item_normal_update() {
|
||||||
|
return " and item.item_hidden = 0 and item.item_type = 0
|
||||||
|
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
|
||||||
|
and item.item_blocked = 0 ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
|
Reference in New Issue
Block a user