diff options
author | Andrew Godwin | 2022-11-12 21:14:21 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-12 21:14:21 -0700 |
commit | 878f56b411279cd9865a7ec05f1d14c9f70f6187 (patch) | |
tree | 93f3c65e109a014041e4380a854bdf8b4dd7fe6d /users/models | |
parent | dd4328ae523bb375dd871e85d1bacd9311e87a89 (diff) | |
download | takahe-878f56b411279cd9865a7ec05f1d14c9f70f6187.tar.gz takahe-878f56b411279cd9865a7ec05f1d14c9f70f6187.tar.bz2 takahe-878f56b411279cd9865a7ec05f1d14c9f70f6187.zip |
Post URIs and host-meta
Diffstat (limited to 'users/models')
-rw-r--r-- | users/models/follow.py | 6 | ||||
-rw-r--r-- | users/models/inbox_message.py | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/users/models/follow.py b/users/models/follow.py index 238081e..0236d19 100644 --- a/users/models/follow.py +++ b/users/models/follow.py @@ -37,7 +37,7 @@ class FollowStates(StateGraph): await HttpSignature.signed_request( uri=follow.target.inbox_uri, body=canonicalise(follow.to_ap()), - private_key=follow.source.public_key, + private_key=follow.source.private_key, key_id=follow.source.public_key_id, ) return cls.local_requested @@ -57,7 +57,7 @@ class FollowStates(StateGraph): await HttpSignature.signed_request( uri=follow.source.inbox_uri, body=canonicalise(follow.to_accept_ap()), - private_key=follow.target.public_key, + private_key=follow.target.private_key, key_id=follow.target.public_key_id, ) return cls.accepted @@ -71,7 +71,7 @@ class FollowStates(StateGraph): await HttpSignature.signed_request( uri=follow.target.inbox_uri, body=canonicalise(follow.to_undo_ap()), - private_key=follow.source.public_key, + private_key=follow.source.private_key, key_id=follow.source.public_key_id, ) return cls.undone_remotely diff --git a/users/models/inbox_message.py b/users/models/inbox_message.py index ea55b17..43424c9 100644 --- a/users/models/inbox_message.py +++ b/users/models/inbox_message.py @@ -66,3 +66,7 @@ class InboxMessage(StatorModel): @property def message_object_type(self): return self.message["object"]["type"].lower() + + @property + def message_actor(self): + return self.message.get("actor") |