1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-29 13:44:51 +09:00

When parsing actor, allow missing sshKey, treat it the same as []

This commit is contained in:
fr33domlover 2019-10-19 09:38:05 +00:00
parent bc379a864f
commit 96c6904b46

View file

@ -370,7 +370,7 @@ instance ActivityPub Actor where
<*> withAuthorityMaybeO authority (o .:? "followers") <*> withAuthorityMaybeO authority (o .:? "followers")
<*> withAuthorityMaybeO authority (o .:? "following") <*> withAuthorityMaybeO authority (o .:? "following")
<*> withAuthorityT authority (parsePublicKeySet =<< o .: "publicKey") <*> withAuthorityT authority (parsePublicKeySet =<< o .: "publicKey")
<*> (traverse (withAuthorityO authority . return) =<< o .: "sshKey") <*> (traverse (withAuthorityO authority . return) =<< o .:? "sshKey" .!= [])
toSeries authority toSeries authority
(Actor id_ typ musername mname msummary inbox outbox followers following pkeys skeys) (Actor id_ typ musername mname msummary inbox outbox followers following pkeys skeys)
= "id" .= ObjURI authority id_ = "id" .= ObjURI authority id_