Get "source" information from Mastodon
We will need this to get the correct draft defaults later.
This commit is contained in:
parent
5043e89837
commit
ea39adf374
|
@ -41,6 +41,12 @@ accessTokenDecoder registration =
|
|||
|> Pipe.hardcoded registration.server
|
||||
|> Pipe.required "access_token" Decode.string
|
||||
|
||||
sourceDecoder : Decode.Decoder Source
|
||||
sourceDecoder =
|
||||
Pipe.decode Source
|
||||
|> Pipe.optional "privacy" Decode.string "public"
|
||||
|> Pipe.optional "sensitive" Decode.bool False
|
||||
|> Pipe.optional "language" Decode.string ""
|
||||
|
||||
accountDecoder : Decode.Decoder Account
|
||||
accountDecoder =
|
||||
|
@ -58,6 +64,11 @@ accountDecoder =
|
|||
|> Pipe.required "statuses_count" Decode.int
|
||||
|> Pipe.required "url" Decode.string
|
||||
|> Pipe.required "username" Decode.string
|
||||
|> Pipe.optional "source" sourceDecoder
|
||||
{ privacy = "public"
|
||||
, sensitive = False
|
||||
, language = ""
|
||||
}
|
||||
|
||||
|
||||
applicationDecoder : Decode.Decoder Application
|
||||
|
|
|
@ -16,6 +16,7 @@ module Mastodon.Model
|
|||
, Relationship
|
||||
, Tag
|
||||
, SearchResults
|
||||
, Source
|
||||
, Status
|
||||
, StatusId(..)
|
||||
, StatusRequestBody
|
||||
|
@ -95,6 +96,7 @@ type alias Account =
|
|||
, statuses_count : Int
|
||||
, url : String
|
||||
, username : String
|
||||
, source : Source
|
||||
}
|
||||
|
||||
|
||||
|
@ -188,6 +190,13 @@ type alias SearchResults =
|
|||
}
|
||||
|
||||
|
||||
type alias Source =
|
||||
{ privacy : String
|
||||
, sensitive : Bool
|
||||
, language : String
|
||||
}
|
||||
|
||||
|
||||
type alias Status =
|
||||
{ account : Account
|
||||
, application : Maybe Application
|
||||
|
|
Loading…
Reference in New Issue