aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/channel.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/mod/channel.php b/mod/channel.php
index 2a0373a81..9df400cbe 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -149,17 +149,19 @@ function channel_content(&$a, $update = 0, $load = false) {
$page_mode = 'client';
+ $abook_uids = " and abook.abook_channel = " . intval($a->profile['profile_uid']) . " ";
+
if(($update) && (! $load)) {
if ($mid) {
- $r = q("SELECT parent AS item_id from item where mid = '%s' and uid = %d AND item_restrict = 0
+ $r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d AND item_restrict = 0
AND (item_flags & %d) > 0 AND item_unseen = 1 $sql_extra limit 1",
- dbesc($mid),
+ dbesc($mid . '%'),
intval($a->profile['profile_uid']),
intval(ITEM_WALL)
);
} else {
$r = q("SELECT distinct parent AS `item_id`, created from item
- left join abook on item.author_xchan = abook.abook_xchan
+ left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
WHERE uid = %d AND item_restrict = 0
AND (item_flags & %d) > 0 AND item_unseen = 1
AND ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)