aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2015-02-09 21:46:22 +0100
committermarijus <mario@mariovavti.com>2015-02-09 21:46:22 +0100
commite2aa0a273c112e01b2f5837f0bca7c7e8d8d4807 (patch)
tree0ddebed23209b3b791bed02b709b0f2d0b494b4e /include
parentd473c3c500a39ce1efdf6902114f899644bcc002 (diff)
downloadvolse-hubzilla-e2aa0a273c112e01b2f5837f0bca7c7e8d8d4807.tar.gz
volse-hubzilla-e2aa0a273c112e01b2f5837f0bca7c7e8d8d4807.tar.bz2
volse-hubzilla-e2aa0a273c112e01b2f5837f0bca7c7e8d8d4807.zip
improve sql query
Diffstat (limited to 'include')
-rw-r--r--include/attach.php7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/attach.php b/include/attach.php
index f61fea9a5..f878a886f 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1258,15 +1258,10 @@ function recursive_activity_recipients($allow_cid, $allow_gid, $deny_cid, $deny_
}
function in_group($group_id) {
- //TODO: make these two queries one with a join.
- $x = q("SELECT id FROM groups WHERE hash = '%s'",
+ $r = q("SELECT xchan FROM group_member left join groups on group_member.gid = group.id WHERE hash = '%s' ",
dbesc($group_id)
);
- $r = q("SELECT xchan FROM group_member WHERE gid = %d",
- intval($x[0]['id'])
- );
-
foreach($r as $ig) {
$group_members[] = $ig['xchan'];
}