aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ping.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-07-05 21:45:13 -0700
committerfriendica <info@friendica.com>2014-07-05 21:45:13 -0700
commit2cd6b2cb2ac285caa2c0051f96bbccb1a8df711e (patch)
tree7004e15961903879da1a6749d60bf36635e7511d /mod/ping.php
parent8f570f147b07407b5a46751dc7504820fba96005 (diff)
downloadvolse-hubzilla-2cd6b2cb2ac285caa2c0051f96bbccb1a8df711e.tar.gz
volse-hubzilla-2cd6b2cb2ac285caa2c0051f96bbccb1a8df711e.tar.bz2
volse-hubzilla-2cd6b2cb2ac285caa2c0051f96bbccb1a8df711e.zip
make the pending connections query consistent between mod/ping and mod/connections
Diffstat (limited to 'mod/ping.php')
-rw-r--r--mod/ping.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/mod/ping.php b/mod/ping.php
index 8a498d543..49475de66 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -269,11 +269,11 @@ function ping_init(&$a) {
if(argc() > 1 && (argv(1) === 'intros')) {
$result = array();
- $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash
- WHERE abook_channel = %d and (abook_flags & %d) and not (abook_flags & %d)",
+ $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) and not ((abook_flags & %d) or (xchan_flags & %d))",
intval(local_user()),
intval(ABOOK_FLAG_PENDING),
- intval(ABOOK_FLAG_SELF)
+ intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED),
+ intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN)
);
if($r) {
@@ -370,9 +370,11 @@ function ping_init(&$a) {
$t2 = dba_timer();
- $intr = q("select count(abook_id) as total from abook where (abook_flags & %d) and abook_channel = %d",
+ $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) and not ((abook_flags & %d) or (xchan_flags & %d))",
+ intval(local_user()),
intval(ABOOK_FLAG_PENDING),
- intval(local_user())
+ intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED),
+ intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN)
);
$t3 = dba_timer();