From 75272cc820fc01dab8c5b030d8fa3ae18a17f1d0 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Sat, 6 May 2017 23:15:22 +0300 Subject: [PATCH] Improve documentation of handle_receive inbound method Sender returned by the method is confusing as it's not necessarily the author of any of the returned entities. Clarify in the docstring. Closes #16 --- federation/inbound.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/federation/inbound.py b/federation/inbound.py index bbcaec6..3ce8bc0 100644 --- a/federation/inbound.py +++ b/federation/inbound.py @@ -13,6 +13,15 @@ PROTOCOLS = ( def handle_receive(payload, user=None, sender_key_fetcher=None, skip_author_verification=False): """Takes a payload and passes it to the correct protocol. + Returns a tuple of: + - sender handle + - protocol name + - list of entities + + NOTE! The returned sender is NOT necessarily the *author* of the entity. By sender here we're + talking about the sender of the *payload*. If this object is being relayed by the sender, the author + could actually be a different identity. + :arg payload: Payload blob (str) :arg user: User that will be passed to `protocol.receive` (required on private encrypted content) :arg sender_key_fetcher: Function that accepts sender handle and returns public key (optional)