aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Messages.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-11-18 10:43:33 +0000
committerMario <mario@mariovavti.com>2022-11-18 10:43:33 +0000
commit59e6989cbcc90ae13eb175e4f1730a9c9d4fc6cd (patch)
treed1a13f8f457f90aba0fb6aa13fc62a094c0f6cbf /Zotlabs/Widget/Messages.php
parent0e6b27c9f46141c3ca92fc8dddc51d866cf5f3c9 (diff)
downloadvolse-hubzilla-59e6989cbcc90ae13eb175e4f1730a9c9d4fc6cd.tar.gz
volse-hubzilla-59e6989cbcc90ae13eb175e4f1730a9c9d4fc6cd.tar.bz2
volse-hubzilla-59e6989cbcc90ae13eb175e4f1730a9c9d4fc6cd.zip
hq widget: implement thread unseen items count
Diffstat (limited to 'Zotlabs/Widget/Messages.php')
-rw-r--r--Zotlabs/Widget/Messages.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php
index 38c822502..199bd8665 100644
--- a/Zotlabs/Widget/Messages.php
+++ b/Zotlabs/Widget/Messages.php
@@ -34,7 +34,8 @@ class Messages {
'starred_messages_title' => t('Starred messages'),
'notice_messages_title' => t('Notices'),
'loading' => t('Loading'),
- 'empty' => t('No messages')
+ 'empty' => t('No messages'),
+ 'unseen' => t('Unseen')
]
]);
@@ -147,14 +148,23 @@ class Messages {
$icon = '';
}
+ $unseen = q("SELECT count(id) AS total FROM item WHERE uid = %d
+ AND parent = %d
+ AND item_thread_top = 0
+ AND item_unseen = 1",
+ intval(local_channel()),
+ intval($item['id'])
+ );
+
$entries[$i]['author_name'] = $item['author']['xchan_name'];
- $entries[$i]['author_addr'] = $item['author']['xchan_addr'] ?? $item['author']['xchan_url'];
+ $entries[$i]['author_addr'] = (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']);
$entries[$i]['info'] = $info;
$entries[$i]['created'] = datetime_convert('UTC', date_default_timezone_get(), $item['created']);
$entries[$i]['summary'] = $summary;
$entries[$i]['b64mid'] = gen_link_id($item['mid']);
$entries[$i]['href'] = z_root() . '/hq/' . gen_link_id($item['mid']);
$entries[$i]['icon'] = $icon;
+ $entries[$i]['unseen'] = (($unseen[0]['total']) ? $unseen[0]['total'] : (($item['item_unseen']) ? '&#8192;' : ''));
$i++;
}