Add support for remote interact (#519)

Add support for remote interaction ([this thing](https://eldritch.cafe/users/Barmaid/remote_follow) in mastodon)

- [x] create the endpoint dispatching remote interactions to local pages
- [x] add this endpoint to web-finger
- [x] propose remote interaction when following and not connected
- [x] propose remote interaction when liking/sharing and not connected
- [x] propose remote interaction when commenting and not connected
- [x] fetch posts/comments we don't know but remote interaction was requested for ?
This commit is contained in:
fdb-hiroshima
2019-04-17 22:09:07 +02:00
committed by Baptiste Gelez
parent 12efe721cc
commit 0d708e1639
28 changed files with 1173 additions and 481 deletions
+6 -3
View File
@@ -110,20 +110,23 @@
</form>
</div>
} else {
<p class="center">@i18n!(ctx.1, "Log in, or use your Fediverse account to interact with this article")</p>
<p class="center">@Html(i18n!(ctx.1, "{0}Log in{1}, or {2}use your Fediverse account{3} to interact with this article";
format!("<a href='{}'>", uri!(session::new: m = _)), "</a>",
format!("<a href='{}'>", uri!(posts::remote_interact: blog_name = &blog.fqn, slug = &article.slug)), "</a>"
))</p>
<div class="actions">
<div class="likes">
<p aria-label="@i18n!(ctx.1, "One like", "{0} likes"; n_likes)" title="@i18n!(ctx.1, "One like", "{0} likes"; n_likes)">
@n_likes
</p>
<a href="@uri!(session::new: m = i18n!(ctx.1, "Log in to like"))" class="action">@icon!("heart") @i18n!(ctx.1, "Add yours")</a>
<a href="@uri!(posts::remote_interact: blog_name = &blog.fqn, slug = &article.slug)" class="action">@icon!("heart") @i18n!(ctx.1, "Add yours")</a>
</div>
<div class="reshares">
<p aria-label="@i18n!(ctx.1, "One boost", "{0} boost"; n_reshares)" title="@i18n!(ctx.1, "One boost", "{0} boosts"; n_reshares)">
@n_reshares
</p>
<a href="@uri!(session::new: m = i18n!(ctx.1, "Log in to boost"))" class="action">@icon!("repeat") @i18n!(ctx.1, "Boost")</a>
<a href="@uri!(posts::remote_interact: blog_name = &blog.fqn, slug = &article.slug)" class="action">@icon!("repeat") @i18n!(ctx.1, "Boost")</a>
</div>
</div>
}