devel #264
2 changed files with 16 additions and 11 deletions
|
@ -25,6 +25,14 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
||||||
%{
|
%{
|
||||||
"type" => "bookmark",
|
"type" => "bookmark",
|
||||||
"name" => "Bookmark"
|
"name" => "Bookmark"
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
"type" => "like",
|
||||||
|
"name" => "Like"
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
"type" => "repost",
|
||||||
|
"name" => "Repost"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
defmodule ChiyaWeb.Indie.Properties do
|
defmodule ChiyaWeb.Indie.Properties do
|
||||||
def get_post_type(properties) do
|
def get_post_type(properties) do
|
||||||
cond do
|
cond do
|
||||||
Map.has_key?(properties, "like-of") ->
|
Map.has_key?(properties, "like-of") -> {:ok, :like}
|
||||||
{:ok, :like}
|
Map.has_key?(properties, "bookmark-of") -> {:ok, :bookmark}
|
||||||
|
Map.has_key?(properties, "content") -> {:ok, :note}
|
||||||
Map.has_key?(properties, "bookmark-of") ->
|
Map.has_key?(properties, "repost-of") -> {:ok, :repost}
|
||||||
{:ok, :bookmark}
|
Map.has_key?(properties, "read-of") -> {:ok, :read}
|
||||||
|
Map.has_key?(properties, "watch-of") -> {:ok, :watch}
|
||||||
Map.has_key?(properties, "content") ->
|
Map.has_key?(properties, "listen-of") -> {:ok, :listen}
|
||||||
{:ok, :note}
|
true -> {:error, :unsupported_posttype}
|
||||||
|
|
||||||
true ->
|
|
||||||
{:error, :unsupported_posttype}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue