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.hardcoded registration.server
|
||||||
|> Pipe.required "access_token" Decode.string
|
|> 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 : Decode.Decoder Account
|
||||||
accountDecoder =
|
accountDecoder =
|
||||||
|
@ -58,6 +64,11 @@ accountDecoder =
|
||||||
|> Pipe.required "statuses_count" Decode.int
|
|> Pipe.required "statuses_count" Decode.int
|
||||||
|> Pipe.required "url" Decode.string
|
|> Pipe.required "url" Decode.string
|
||||||
|> Pipe.required "username" Decode.string
|
|> Pipe.required "username" Decode.string
|
||||||
|
|> Pipe.optional "source" sourceDecoder
|
||||||
|
{ privacy = "public"
|
||||||
|
, sensitive = False
|
||||||
|
, language = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
applicationDecoder : Decode.Decoder Application
|
applicationDecoder : Decode.Decoder Application
|
||||||
|
|
|
@ -16,6 +16,7 @@ module Mastodon.Model
|
||||||
, Relationship
|
, Relationship
|
||||||
, Tag
|
, Tag
|
||||||
, SearchResults
|
, SearchResults
|
||||||
|
, Source
|
||||||
, Status
|
, Status
|
||||||
, StatusId(..)
|
, StatusId(..)
|
||||||
, StatusRequestBody
|
, StatusRequestBody
|
||||||
|
@ -95,6 +96,7 @@ type alias Account =
|
||||||
, statuses_count : Int
|
, statuses_count : Int
|
||||||
, url : String
|
, url : String
|
||||||
, username : String
|
, username : String
|
||||||
|
, source : Source
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -188,6 +190,13 @@ type alias SearchResults =
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
type alias Source =
|
||||||
|
{ privacy : String
|
||||||
|
, sensitive : Bool
|
||||||
|
, language : String
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
type alias Status =
|
type alias Status =
|
||||||
{ account : Account
|
{ account : Account
|
||||||
, application : Maybe Application
|
, application : Maybe Application
|
||||||
|
|
Loading…
Reference in New Issue