License federation (#343)

* Federate license

* Make it possible to use no license
This commit is contained in:
Baptiste Gelez
2018-12-09 18:43:34 +01:00
committed by GitHub
parent e9f2f769be
commit b73fbd3768
16 changed files with 126 additions and 45 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
use activitypub::{activity::Create, collection::OrderedCollection, object::Article};
use activitypub::{activity::Create, collection::OrderedCollection};
use atom_syndication::{Entry, FeedBuilder};
use rocket::{
http::{ContentType, Cookies},
@@ -18,7 +18,7 @@ use plume_common::activity_pub::{
};
use plume_common::utils;
use plume_models::{
blogs::Blog, db_conn::DbConn, follows, headers::Headers, instance::Instance, posts::Post,
blogs::Blog, db_conn::DbConn, follows, headers::Headers, instance::Instance, posts::{LicensedArticle, Post},
reshares::Reshare, users::*,
};
use routes::Page;
@@ -56,7 +56,7 @@ pub fn details(
let searcher = searcher.clone();
worker.execute(move || {
for create_act in user_clone.fetch_outbox::<Create>() {
match create_act.create_props.object_object::<Article>() {
match create_act.create_props.object_object::<LicensedArticle>() {
Ok(article) => {
Post::from_activity(
&(&*fetch_articles_conn, &searcher),