diff --git a/src/Mastodon/Decoder.elm b/src/Mastodon/Decoder.elm index bc9b029..e84142b 100644 --- a/src/Mastodon/Decoder.elm +++ b/src/Mastodon/Decoder.elm @@ -210,6 +210,7 @@ relationshipDecoder = |> Pipe.required "following" Decode.bool |> Pipe.required "muting" Decode.bool |> Pipe.required "requested" Decode.bool + |> Pipe.required "blocked_by" Decode.bool tagDecoder : Decode.Decoder Tag diff --git a/src/Mastodon/Model.elm b/src/Mastodon/Model.elm index bdf708a..29f6e14 100644 --- a/src/Mastodon/Model.elm +++ b/src/Mastodon/Model.elm @@ -231,6 +231,7 @@ type alias Relationship = , following : Bool , muting : Bool , requested : Bool + , blocked_by : Bool } diff --git a/src/View/Account.elm b/src/View/Account.elm index 08a357b..b51c94c 100644 --- a/src/View/Account.elm +++ b/src/View/Account.elm @@ -81,11 +81,18 @@ followButton currentUser relationship account = , "Unfollow" ) else - ( FollowAccount account - , "btn btn-default btn-follow" - , "eye-open" - , "Follow" - ) + if relationship.requested then + ( UnfollowAccount account + , "btn btn-default btn-follow btn-warning" + , "remove-sign" + , "Cancel follow request" + ) + else + ( FollowAccount account + , "btn btn-default btn-follow" + , "eye-open" + , "Follow" + ) in button [ class btnClasses, title tooltip, onClick followEvent ] [ Common.icon iconName ] @@ -376,6 +383,10 @@ accountView subView currentUser accountInfo = span [ class "badge blocking" ] [ text "Blocked" ] else text "" + , if relationship.blocked_by then + span [ class "badge blocking" ] [ text "Blocks you" ] + else + text "" ] Nothing ->