devel #264

Merged
inhji merged 12 commits from devel into main 2023-08-16 22:55:36 +02:00
2 changed files with 16 additions and 11 deletions
Showing only changes of commit 0267ae07d8 - Show all commits

View file

@ -25,6 +25,14 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
%{
"type" => "bookmark",
"name" => "Bookmark"
},
%{
"type" => "like",
"name" => "Like"
},
%{
"type" => "repost",
"name" => "Repost"
}
]

View file

@ -1,17 +1,14 @@
defmodule ChiyaWeb.Indie.Properties do
def get_post_type(properties) do
cond do
Map.has_key?(properties, "like-of") ->
{:ok, :like}
Map.has_key?(properties, "bookmark-of") ->
{:ok, :bookmark}
Map.has_key?(properties, "content") ->
{:ok, :note}
true ->
{:error, :unsupported_posttype}
Map.has_key?(properties, "like-of") -> {:ok, :like}
Map.has_key?(properties, "bookmark-of") -> {:ok, :bookmark}
Map.has_key?(properties, "content") -> {:ok, :note}
Map.has_key?(properties, "repost-of") -> {:ok, :repost}
Map.has_key?(properties, "read-of") -> {:ok, :read}
Map.has_key?(properties, "watch-of") -> {:ok, :watch}
Map.has_key?(properties, "listen-of") -> {:ok, :listen}
true -> {:error, :unsupported_posttype}
end
end