aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Daemon/Importdoc.php7
-rw-r--r--Zotlabs/Module/Sse_bs.php10
-rw-r--r--include/items.php3
3 files changed, 12 insertions, 8 deletions
diff --git a/Zotlabs/Daemon/Importdoc.php b/Zotlabs/Daemon/Importdoc.php
index 46f96098f..de571848e 100644
--- a/Zotlabs/Daemon/Importdoc.php
+++ b/Zotlabs/Daemon/Importdoc.php
@@ -11,15 +11,18 @@ class Importdoc {
self::update_docs_dir('doc/*');
+ $sys = get_sys_channel();
+
// remove old files that weren't updated (indicates they were most likely deleted).
- $i = q("select id, uid from item where item_type = 5 and edited < %s - INTERVAL %s",
+ $i = q("select id from item where uid = %d and item_type = 5 and edited < %s - INTERVAL %s",
+ intval($sys['channel_id']),
db_utcnow(),
db_quoteinterval('14 DAY')
);
if ($i) {
foreach ($i as $iv) {
- drop_item($iv['id'], uid: $iv['uid']);
+ drop_item($iv['id'], uid: $sys['channel_id']);
}
}
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index d214ba28f..5292abfaa 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -207,7 +207,7 @@ class Sse_bs extends Controller {
$item_normal
$sql_extra
$sql_extra2
- ORDER BY created DESC LIMIT $limit OFFSET $offset",
+ ORDER BY created DESC, received DESC LIMIT $limit OFFSET $offset",
intval(self::$uid),
dbescdate($_SESSION['sse_loadtime']),
dbesc(self::$ob_hash)
@@ -290,7 +290,7 @@ class Sse_bs extends Controller {
$item_normal
$sql_extra
$sql_extra2
- ORDER BY created DESC LIMIT $limit OFFSET $offset",
+ ORDER BY created DESC, received DESC LIMIT $limit OFFSET $offset",
intval(self::$uid),
dbescdate($_SESSION['sse_loadtime']),
dbesc(self::$ob_hash)
@@ -373,7 +373,7 @@ class Sse_bs extends Controller {
$item_normal
$sql_extra
$sql_extra2
- ORDER BY created DESC LIMIT $limit OFFSET $offset",
+ ORDER BY created DESC, received DESC LIMIT $limit OFFSET $offset",
intval(self::$uid),
dbescdate($_SESSION['sse_loadtime']),
dbesc(self::$ob_hash)
@@ -481,7 +481,7 @@ class Sse_bs extends Controller {
$sql_extra
$sql_extra2
$sql_extra3
- ORDER BY created DESC LIMIT $limit OFFSET $offset",
+ ORDER BY created DESC, received DESC LIMIT $limit OFFSET $offset",
dbescdate($_SESSION['sse_loadtime']),
dbesc(self::$ob_hash),
dbescdate($_SESSION['last_login_date'] ?? $_SESSION['static_loadtime'])
@@ -679,7 +679,7 @@ class Sse_bs extends Controller {
AND author_xchan != '%s'
AND item_unseen = 1
$item_normal
- ORDER BY created DESC",
+ ORDER BY created DESC, received DESC",
dbesc(ACTIVITY_POST),
intval(self::$uid),
dbesc(self::$ob_hash)
diff --git a/include/items.php b/include/items.php
index 03a21c73d..ff683260d 100644
--- a/include/items.php
+++ b/include/items.php
@@ -5291,7 +5291,8 @@ function addToCollectionAndSync($ret) {
}
xchan_query($items);
- $items = fetch_post_tags($items);
+ // TODO: fetch_post_tags() will add term and iconfig twice if called twice and it looks like they are already added here
+ // $items = fetch_post_tags($items);
$sync_items = [];
$sync_items[] = encode_item($items[0], true);