diff --git a/litecord/blueprints/users.py b/litecord/blueprints/users.py index d1a3b29..2ed1076 100644 --- a/litecord/blueprints/users.py +++ b/litecord/blueprints/users.py @@ -378,14 +378,17 @@ async def get_library(): async def get_profile(peer_id: int): """Get a user's profile.""" user_id = await token_check() - - # TODO: check if they have any mutual guilds, - # and return empty profile if they don't. peer = await app.storage.get_user(peer_id) if not peer: return '', 404 + mutuals = await app.user_storage.get_mutual_guilds(user_id, peer_id) + + # don't return a proper card if no guilds are being shared. + if not mutuals: + return '', 404 + # actual premium status is determined by that # column being NULL or not peer_premium = await app.db.fetchval("""