From 0742ff20b01eba892143cfde6450f4e8a3c24b3c Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 17 Aug 2018 17:36:05 -0500 Subject: [PATCH] actor: check if the inbound message is an auth message or not --- viera/actor.py | 6 +++++- viera/authreqs.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/viera/actor.py b/viera/actor.py index c2ff2ac..a9696e7 100644 --- a/viera/actor.py +++ b/viera/actor.py @@ -90,7 +90,11 @@ from .authreqs import check_reqs async def handle_create(actor, data, request): content = strip_html(data['object']['content']).split() - check_reqs(content, actor) + + # check if the message is an authorization token for linking identities together + # if it is, then it's not a message we want to relay to IRC. + if check_reqs(content, actor): + return async def handle_follow(actor, data, request): diff --git a/viera/authreqs.py b/viera/authreqs.py index 85e7286..d70aa7e 100644 --- a/viera/authreqs.py +++ b/viera/authreqs.py @@ -33,6 +33,8 @@ def check_reqs(chunks, actor): DATABASE["auths"][req.irc_account] = req.actor + return True in results + def new_auth_req(irc_nickname, irc_account): authid = str(uuid.uuid4())