From 03e096a839a47770acd069631cdb8f48903d7590 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 18 Aug 2018 00:07:49 -0500 Subject: [PATCH] actor: don't relay non-public messages --- viera/actor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/viera/actor.py b/viera/actor.py index 0ef99d6..177da7f 100644 --- a/viera/actor.py +++ b/viera/actor.py @@ -144,9 +144,12 @@ async def handle_create(actor, data, request): if check_reqs(content, actor): return - # fetch our IRC bot - bot = get_irc_bot() - bot.relay_message(actor, data['object'], ' '.join(content)) + # check that the message is public before relaying + public_uri = 'https://www.w3.org/ns/activitystreams#Public' + + if public_uri in data.get('to', []) or public_uri in data.get('cc', []): + bot = get_irc_bot() + bot.relay_message(actor, data['object'], ' '.join(content)) async def handle_follow(actor, data, request):