- $r = q("SELECT `group_member`.`contact-id`, `contact`.* FROM `group_member`
- INNER JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id`
- WHERE `gid` = %d AND `group_member`.`uid` = %d ORDER BY `contact`.`name` ASC ",
+ $r = q("SELECT `group_member`.`contact-id`, `contact`.* FROM `group_member`
+ INNER JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id`
+ WHERE `gid` = %d AND `group_member`.`uid` = %d AND
+ NOT `contact`.`self` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
+ ORDER BY `contact`.`name` ASC ",