Support "like" web mentions
This commit is contained in:
@@ -21,6 +21,17 @@ module Adamantium
|
|||||||
target_url: wm_params[:"in-reply-to"]
|
target_url: wm_params[:"in-reply-to"]
|
||||||
}]
|
}]
|
||||||
when "like-of"
|
when "like-of"
|
||||||
|
Success[:like, {
|
||||||
|
type: "like",
|
||||||
|
author_name: wm_params[:author][:name],
|
||||||
|
author_photo: wm_params[:author][:photo],
|
||||||
|
author_url: wm_params[:author][:url],
|
||||||
|
published_at: wm_params[:published],
|
||||||
|
content_html: wm_params[:content][:html],
|
||||||
|
content_text: wm_params[:content][:text],
|
||||||
|
source_url: wm_params[:url],
|
||||||
|
target_url: wm_params[:"in-reply-to"]
|
||||||
|
}]
|
||||||
Failure(:not_implemented)
|
Failure(:not_implemented)
|
||||||
when "repost-of"
|
when "repost-of"
|
||||||
Failure(:not_implemented)
|
Failure(:not_implemented)
|
||||||
|
@@ -18,6 +18,17 @@ module Micropub
|
|||||||
|
|
||||||
reply[:post_id] = post.id
|
reply[:post_id] = post.id
|
||||||
|
|
||||||
|
webmentions_repo.create(reply)
|
||||||
|
res.body = {
|
||||||
|
result: "Webmention was successful"
|
||||||
|
}.to_json
|
||||||
|
res.status = 202
|
||||||
|
in Success[:like, like]
|
||||||
|
slug = req.params[:"like-of"].split("/").last
|
||||||
|
post = post_repo.fetch!(slug)
|
||||||
|
|
||||||
|
reply[:post_id] = post.id
|
||||||
|
|
||||||
webmentions_repo.create(reply)
|
webmentions_repo.create(reply)
|
||||||
res.body = {
|
res.body = {
|
||||||
result: "Webmention was successful"
|
result: "Webmention was successful"
|
||||||
|
Reference in New Issue
Block a user