diff options
Diffstat (limited to 'mod/ping.php')
-rw-r--r-- | mod/ping.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/mod/ping.php b/mod/ping.php index b676726fe..d43694358 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -156,8 +156,7 @@ function ping_init(&$a) { ); break; case 'home': - $r = q("update item set item_unseen = 0 where item_unseen = 1 and (item_flags & %d) > 0 and uid = %d", - intval(ITEM_WALL), + $r = q("update item set item_unseen = 0 where item_unseen = 1 and item_wall = 1 and uid = %d", intval(local_channel()) ); break; @@ -282,7 +281,7 @@ function ping_init(&$a) { if($r) { xchan_query($r); foreach($r as $item) { - if((argv(1) === 'home') && (! ($item['item_flags'] & ITEM_WALL))) + if((argv(1) === 'home') && (! intval($item['item_wall']))) continue; $result[] = format_notification($item); } @@ -295,11 +294,10 @@ function ping_init(&$a) { if(argc() > 1 && (argv(1) === 'intros')) { $result = array(); - $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0) ORDER BY abook_created DESC LIMIT 50", + $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or xchan_deleted = 1 or xchan_orphan = 1) ORDER BY abook_created DESC LIMIT 50", intval(local_channel()), intval(ABOOK_FLAG_PENDING), - intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED), - intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) + intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED) ); if($r) { @@ -379,7 +377,7 @@ function ping_init(&$a) { if($vnotify & (VNOTIFY_NETWORK|VNOTIFY_CHANNEL)) { $r = q("SELECT id, item_restrict, item_flags FROM item - WHERE item_restrict = 0 and item_unseen = 1 and uid = %d + WHERE (item_restrict = 0) and item_unseen = 1 and uid = %d and author_xchan != '%s'", intval(local_channel()), dbesc($ob_hash) @@ -390,7 +388,7 @@ function ping_init(&$a) { call_hooks('network_ping', $arr); foreach ($r as $it) { - if($it['item_flags'] & ITEM_WALL) + if(intval($it['item_wall'])) $result['home'] ++; else $result['network'] ++; @@ -406,11 +404,10 @@ function ping_init(&$a) { $t2 = dba_timer(); if($vnotify & VNOTIFY_INTRO) { - $intr = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0)", + $intr = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or xchan_deleted = 1 or xchan_orphan = 1)", intval(local_channel()), intval(ABOOK_FLAG_PENDING), - intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED), - intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) + intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED) ); $t3 = dba_timer(); |