(
    SELECT b.*
    FROM (users       AS a INNER JOIN
          friendships AS b ON a.userId = b.activeId) INNER JOIN
          users       AS c ON c.userId = b.passiveId
    WHERE a.remove       = false AND
          a.growl        = true AND
          b.passiveId    = /*passiveId*/0 AND
          b.accept       = true AND
          b.notify       = true AND
          b.removedTime  = 0 AND
          c.protect      = true AND
          c.remove       = false
    ORDER BY b.activeId
) UNION ALL (
    SELECT b.*
    FROM (users       AS a INNER JOIN
          friendships AS b ON a.userId = b.activeId) INNER JOIN
          users       AS c ON c.userId = b.passiveId
    WHERE a.remove       = false AND
          a.growl        = true AND
          b.passiveId    = /*passiveId*/0 AND
          b.notify       = true AND
          b.removedTime  = 0 AND
          c.protect      = false AND
          c.remove       = false
    ORDER BY b.activeId
)
ORDER BY activeId
LIMIT /*offset*/0, /*limit*/1
